Board index » delphi » Delphi 5 is eating memory

Delphi 5 is eating memory

Hello there,

I've an extensive project which I load in Delphi 5 under WinNt. When I look
at the TaskManager I see that every second about 160 K of memory disappears.
I'm not running the sourcecode at that moment, I only loaded it into the IDE
! This will continue until I get messages that my system is running low on
virtual memory of course. (I'v got a swapfile of 1 Mb and that's normally
enough). It happens only with that project, when I load another project and
use the same packages, all is normal. I used Snoop and MemProof to check for
memoryleaks, but everything seems to be ok. The executable run outside the
IDE is NOT stealing memory. WHO HAS A CLUE???

Herman

 

Re:Delphi 5 is eating memory


"Herman van der Hoek" <hvdh...@wanadoo.nl> wrote in message
news:96b9ge$28lg$1@buty.wanadoo.nl...

Quote
> Hello there,

> I've an extensive project which I load in Delphi 5 under WinNt. When I
look
> at the TaskManager I see that every second about 160 K of memory
disappears.
> I'm not running the sourcecode at that moment, I only loaded it into the
IDE
> ! This will continue until I get messages that my system is running low on
> virtual memory of course. (I'v got a swapfile of 1 Mb and that's normally

1 MB swapfile, is this a typo?

Re:Delphi 5 is eating memory


Quote
>...... (I'v got a swapfile of 1 Mb and that's normally
> enough). It happens only with that project, when I load another project
and
> use the same packages, all is normal. I used Snoop and MemProof to check
for
> memoryleaks, but everything seems to be ok. The executable run outside the
> IDE is NOT stealing memory. WHO HAS A CLUE???

Swap file of 1Mb?  All the Windows NT sites I've visited recommend you set
your swap file (pagefile.sys) to at least the size of physical RAM + 12 MB,
so if you have 128 MB RAM it should be 140MB.  That should be your first
thing to fix.

Re:Delphi 5 is eating memory


Yes, sorry, it's a typo. Make it a 1 Gig swapfile !!

Quote
"Sailor" <r...@tsteeldedeviltails.com> wrote in message

news:86ci6.783$466.63862@news1.atl...
Quote
> >...... (I'v got a swapfile of 1 Mb and that's normally
> > enough). It happens only with that project, when I load another project
> and
> > use the same packages, all is normal. I used Snoop and MemProof to check
> for
> > memoryleaks, but everything seems to be ok. The executable run outside
the
> > IDE is NOT stealing memory. WHO HAS A CLUE???

> Swap file of 1Mb?  All the Windows NT sites I've visited recommend you set
> your swap file (pagefile.sys) to at least the size of physical RAM + 12
MB,
> so if you have 128 MB RAM it should be 140MB.  That should be your first
> thing to fix.

Re:Delphi 5 is eating memory


I found the solution this morning, triggered by a discussion in
borland.public.delphi.ide about memory-laeks in D5 IDE.
For reasons of versioncontrol I moved my project a while ago to a different
directory-structure. Of course also the directory with dcu files was moved.
A compile or build was working ok, but I noticed that every second a 160 KB
disappeared. This morning I discovered that some pathnames of the 115 units
in the projectfile were not correct. After I corrected this, saved the
project, closed Delphi en opened the project again, the problem was gone.
Apparently the IDE keeps searching for the files from the project-file,
although they are found as DCU-files.
I consider this a bug: At least a warning should be given.

Cheers, Herman van der Hoek.

"Herman van der Hoek" <hvdh...@wanadoo.nl> wrote in message
news:96b9ge$28lg$1@buty.wanadoo.nl...

Quote
> Hello there,

> I've an extensive project which I load in Delphi 5 under WinNt. When I
look
> at the TaskManager I see that every second about 160 K of memory
disappears.
> I'm not running the sourcecode at that moment, I only loaded it into the
IDE
> ! This will continue until I get messages that my system is running low on
> virtual memory of course. (I'v got a swapfile of 1 Mb and that's normally
> enough). It happens only with that project, when I load another project
and
> use the same packages, all is normal. I used Snoop and MemProof to check
for
> memoryleaks, but everything seems to be ok. The executable run outside the
> IDE is NOT stealing memory. WHO HAS A CLUE???

> Herman

Re:Delphi 5 is eating memory


On Tue, 13 Feb 2001 10:10:01 -0500, "Sailor"

Quote
<r...@tsteeldedeviltails.com> wrote:

>Swap file of 1Mb?  All the Windows NT sites I've visited recommend you set
>your swap file (pagefile.sys) to at least the size of physical RAM + 12 MB,
>so if you have 128 MB RAM it should be 140MB.  That should be your first
>thing to fix.

Actually, this is incorrect. The chosen swap file size should in fact
be inversely proportional to the amount of RAM. ie. A machine with
256MB RAM is not going to need as much swap space as one with 64MB.

The necessary size of your swap file depends largely on what you use
the machine for, and, of course, how much space you've got available.

A 1Gb combined size is probably ideal for most users, except those
into video editing, or something equally as expensive in terms of
memory.

I wouldn't recommend going under about 500Mb (combined), but most ppl
can probably get away with around 200-300Mb. Again, it depends on your
usage levels. If you generally only have 1 or 2 windows open at a
time, of (relatively) inexpensive apps such as browsers & word
processors, you don't really need very much at all.

It's also a good idea to have a seperate swap partition, so that if
you haven't defragged your drive for a while, your performance doesn't
drop as much. I'm not too sure about NT, as I primarily use Win9X and
Linux, and I've got a funny feeling you've got to set the swap size
for each drive under NT. I might be completely mistaken, though.

Although not addressing your original problem, I hope this clears up
the common error of setting your swap size to the same size (or
similar) as your RAM.

Re:Delphi 5 is eating memory


"Gurble" <gurbleREM...@THISclear.net.nz> skrev i melding
news:b8qk8tk72f2v2h6p41na3841amt8eojjvt@4ax.com...

Quote

> On Tue, 13 Feb 2001 10:10:01 -0500, "Sailor"
> <r...@tsteeldedeviltails.com> wrote:

> >Swap file of 1Mb?  All the Windows NT sites I've visited recommend you set
> >your swap file (pagefile.sys) to at least the size of physical RAM + 12
MB,
> >so if you have 128 MB RAM it should be 140MB.  That should be your first
> >thing to fix.

> Actually, this is incorrect. The chosen swap file size should in fact
> be inversely proportional to the amount of RAM. ie. A machine with
> 256MB RAM is not going to need as much swap space as one with 64MB.

I've seen recommendations on proportional RAM / Swap file sizes, too. I guess
the reason is, when an application can enjoy 1 Gb of Virtual memory when 64Mb
RAM is installed, the chance the interesting portions will recide in RAM is
little. You kind of "fool" the applications to believe it may use more RAM
than it should (concidering performance). For most apllications this is
irrelevant, I guess, but I've run into this topic with database servers.
--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorgeremovet...@itte.no (remove the obvious)

Re:Delphi 5 is eating memory


Quote
Gurble wrote:

> On Tue, 13 Feb 2001 10:10:01 -0500, "Sailor"
> <r...@tsteeldedeviltails.com> wrote:

> >Swap file of 1Mb?  All the Windows NT sites I've visited recommend you set
> >your swap file (pagefile.sys) to at least the size of physical RAM + 12 MB,
> >so if you have 128 MB RAM it should be 140MB.  That should be your first
> >thing to fix.

> Actually, this is incorrect.

Actually he is quite correct - particularly for NT and W2K.

Quote
>The chosen swap file size should in fact be inversely proportional
> to the amount of RAM. ie. A machine with 256MB RAM is not going
> to need as much swap space as one with 64MB.

Whether a machine with 256 MB of RAM needs more or less swap file
space than one with 64 MB depends entirely on what the user does
with that machine.  Personally I run NT4 on a system with 256 MB of
RAM, with a 512 MB page file - and my page file usage so far has
maxed out at about 400 MB.

Spend a little time in the NT newsgroups and you will find
that I am far from being the only NT Admin who recommends
that you set your page file minimum to at least twice the
amount of RAM you have.   When you get to multi-GB systems
then you can _usually_ safely drop your page file down to
RAM+12.

A VERY important consideration for NT and W2K is that if the
total size for all of your page files is less than RAM+12, then
if the OS ever needs more page file space it will create a
temporary page file in your %SystemRoot%\system32 folder.  
No big deal unless the OS needs another 300 MB for paging and
you only have 299 MB left - and then if you are LUCKY a simple
reboot will get you out of the mess.

Hence, for safety reasons a 256 MB NT or W2K machine _DOES_ need
a larger page file than one with only 64 MB.    

Hard drive space is dirt cheap - cheaper than the time it
takes to deal with a user whose system crashed because you
were too stingy in your page file allocations.   And with
most servers it is hard to explain to the boss that your
$30K server with 4 GB of RAM crashed because you were too
stupid to spend another $400 for a small, fast hard drive
that would give you all the page file space you could
ever need.

Note also that with NT and W2K any RAM used by apps that have
been idle for a while WILL be swapped out to the page/swap file.  
It doesn't matter whether or not the OS needs the RAM for
something else - idle RAM is swapped out. Period.   Hence, if
I load my 256 MB of RAM up with active apps and minimal swap
file usage and then go for a coffee break, when I come back
everything will have been swapped out.

Quote
> It's also a good idea to have a seperate swap partition, so that if
> you haven't defragged your drive for a while, your performance doesn't
> drop as much.

Set the swap/page file minimum and maximum to the same value and
a page file of that size will be permanently allocated.  Hence it
will never become more fragmented than it was at the time it was
allocated.

As well, putting the swap file on a dedicated partition will
IMPAIR system performance unless that partition is on a
drive that is not otherwise used a lot.   There is a lot of
time wasted when the drive heads are constantly moving back
and forth between your system partition and your swap
partition when you have them both on the same physical drive.

An excellent rule of thumb is that your swap file should be
on the MOST used partition on your LEAST used drive.   Hence,
if you have  only one hard drive in your system, put your swap
file on the system partition since it is usually the most
heavily used partition.

If you have a tiny 1.6 GB hard drive gathering dust somewhere,
put it back in your system and use it for a dedicated swap
drive.  (Assuming, of course, that 1.6 GB is large enough
for your swap file.) If you have a dedicated swap partition,
format it as FAT16 using the largest cluster size that the
OS supports (32 KB for Win9x and Win ME, 64 KB for NT and W2K).

Quote
>I'm not too sure about NT, as I primarily use Win9X and
> Linux, and I've got a funny feeling you've got to set the swap size
> for each drive under NT. I might be completely mistaken, though.

You are completely mistaken.   You _can_ put a swap file on
every partition with NT and W2K - however, you only NEED one.

About the only time multiple page files are justified is when
you need a total size of more than 4 GB since neither NT nor
W2K allows any single page file to exceed 4 GB.  

Quote

> Although not addressing your original problem, I hope this clears up
> the common error of setting your swap size to the same size (or
> similar) as your RAM.

It does not clear it up for him.   You spread dangerous misinformation
that is probably going to{*word*211}off the sysadmin at his workplace when
he starts to phone the help desk about "insufficient virtual memory".
You are the kind of user that SysAdmins dread - you know just enough
to be dangerous.

Rob

Re:Delphi 5 is eating memory


Hey guys,

I thougt this was a discussion about a bug in Delphi5 IDE and not about
swapfiles. See my message posted Feb 14 at 9:40AM

Herman van der Hoek

Quote
"Rob Stow" <rob.s...@cnnsimail.com> wrote in message

news:3A8ADD32.A2AA3575@cnnsimail.com...
Quote
> Gurble wrote:

> > On Tue, 13 Feb 2001 10:10:01 -0500, "Sailor"
> > <r...@tsteeldedeviltails.com> wrote:

> > >Swap file of 1Mb?  All the Windows NT sites I've visited recommend you
set
> > >your swap file (pagefile.sys) to at least the size of physical RAM + 12
MB,
> > >so if you have 128 MB RAM it should be 140MB.  That should be your
first
> > >thing to fix.

> > Actually, this is incorrect.

> Actually he is quite correct - particularly for NT and W2K.

> >The chosen swap file size should in fact be inversely proportional
> > to the amount of RAM. ie. A machine with 256MB RAM is not going
> > to need as much swap space as one with 64MB.

> Whether a machine with 256 MB of RAM needs more or less swap file
> space than one with 64 MB depends entirely on what the user does
> with that machine.  Personally I run NT4 on a system with 256 MB of
> RAM, with a 512 MB page file - and my page file usage so far has
> maxed out at about 400 MB.

> Spend a little time in the NT newsgroups and you will find
> that I am far from being the only NT Admin who recommends
> that you set your page file minimum to at least twice the
> amount of RAM you have.   When you get to multi-GB systems
> then you can _usually_ safely drop your page file down to
> RAM+12.

> A VERY important consideration for NT and W2K is that if the
> total size for all of your page files is less than RAM+12, then
> if the OS ever needs more page file space it will create a
> temporary page file in your %SystemRoot%\system32 folder.
> No big deal unless the OS needs another 300 MB for paging and
> you only have 299 MB left - and then if you are LUCKY a simple
> reboot will get you out of the mess.

> Hence, for safety reasons a 256 MB NT or W2K machine _DOES_ need
> a larger page file than one with only 64 MB.

> Hard drive space is dirt cheap - cheaper than the time it
> takes to deal with a user whose system crashed because you
> were too stingy in your page file allocations.   And with
> most servers it is hard to explain to the boss that your
> $30K server with 4 GB of RAM crashed because you were too
> stupid to spend another $400 for a small, fast hard drive
> that would give you all the page file space you could
> ever need.

> Note also that with NT and W2K any RAM used by apps that have
> been idle for a while WILL be swapped out to the page/swap file.
> It doesn't matter whether or not the OS needs the RAM for
> something else - idle RAM is swapped out. Period.   Hence, if
> I load my 256 MB of RAM up with active apps and minimal swap
> file usage and then go for a coffee break, when I come back
> everything will have been swapped out.

> > It's also a good idea to have a seperate swap partition, so that if
> > you haven't defragged your drive for a while, your performance doesn't
> > drop as much.

> Set the swap/page file minimum and maximum to the same value and
> a page file of that size will be permanently allocated.  Hence it
> will never become more fragmented than it was at the time it was
> allocated.

> As well, putting the swap file on a dedicated partition will
> IMPAIR system performance unless that partition is on a
> drive that is not otherwise used a lot.   There is a lot of
> time wasted when the drive heads are constantly moving back
> and forth between your system partition and your swap
> partition when you have them both on the same physical drive.

> An excellent rule of thumb is that your swap file should be
> on the MOST used partition on your LEAST used drive.   Hence,
> if you have  only one hard drive in your system, put your swap
> file on the system partition since it is usually the most
> heavily used partition.

> If you have a tiny 1.6 GB hard drive gathering dust somewhere,
> put it back in your system and use it for a dedicated swap
> drive.  (Assuming, of course, that 1.6 GB is large enough
> for your swap file.) If you have a dedicated swap partition,
> format it as FAT16 using the largest cluster size that the
> OS supports (32 KB for Win9x and Win ME, 64 KB for NT and W2K).

> >I'm not too sure about NT, as I primarily use Win9X and
> > Linux, and I've got a funny feeling you've got to set the swap size
> > for each drive under NT. I might be completely mistaken, though.

> You are completely mistaken.   You _can_ put a swap file on
> every partition with NT and W2K - however, you only NEED one.

> About the only time multiple page files are justified is when
> you need a total size of more than 4 GB since neither NT nor
> W2K allows any single page file to exceed 4 GB.

> > Although not addressing your original problem, I hope this clears up
> > the common error of setting your swap size to the same size (or
> > similar) as your RAM.

> It does not clear it up for him.   You spread dangerous misinformation
> that is probably going to{*word*211}off the sysadmin at his workplace when
> he starts to phone the help desk about "insufficient virtual memory".
> You are the kind of user that SysAdmins dread - you know just enough
> to be dangerous.

> Rob

Re:Delphi 5 is eating memory


Hey,{*word*106}head. Before you start flaming ppl, maybe you should actually
read my post.

I believe I made it quite clear that I was speaking from a Win9X &
Linux perspective, even saying that I wasn't too sure about NT. I
still stand behind my points (in regard to 9X & Linux).

If you can't handle someone offering an opinion that might differ from
your own, (as there are many opinions about optimal swap file sizes),
then I suggest you go quietly to hell.

And as for your wee remark at the bottom of your post, you are the
kind of user that most ppl in the civilized world dread - you believe
you know everything about everything, and if someone's opinion differs
from your own, you get so upset, you're dangerous.

Go to hell. I was just trying to provide some help, which I still
maintain is relevant. (even if Win NT handles things a little
differently - a fact that I made clear in my post I knew little about)

Re:Delphi 5 is eating memory


Quote
Gurble wrote:

> Hey,{*word*106}head.

Ah !  I see where the problem is - you are still a pre-{*word*249} and
thus you were speaking from very limited experience.

Rob

Other Threads