 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
SH Guest
|
Posted: Thu Nov 10, 2005 8:46 pm Post subject: Huge strings and Out of Memory |
|
|
Hi
I have a simple application containing this code:
---
var s : string;
begin
setlength(s, 1024*1024*512);
showmessage('ok');
setlength(s, 1024*1024*1024);
showmessage('ok');
...
---
The problem is that Delphi spits our an 'Out of Memory' error even though
there's more than 1.2GB free memory available
On the other hand, this code works fine:
---
var s : string;
begin
setlength(s, 1024*1024*1024);
showmessage('ok');
...
---
So it seems like Delphi creates a whole new memory allocation containing
'1024*1024*1024' bytes before unassigning any of the previosuly assigned
'1024*1024*512' bytes.
Is there a work-around for this, so I can make the first code example above
work?
Thanks in advance
Simon
|
|
| Back to top |
|
 |
Riki Wiki Guest
|
Posted: Fri Nov 11, 2005 9:16 pm Post subject: Re: Huge strings and Out of Memory |
|
|
On Thu, 10 Nov 2005 21:46:57 +0100, SH wrote:
| Quote: | Is there a work-around for this, so I can make the first code example above
work?
|
Hoi Simon
You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this newsgroup
do not officially exist, use newsgroup b.p.d.language.delphi.general.
Take a look here:
<http://tinyurl.com/8m5nw>
which links to
<http://delphi.wikicities.com/wiki/Delphi_Newsgroups>
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|