restrict growing VM of a process

  • Thread starter Thread starter Navneet Kumar
  • Start date Start date
N

Navneet Kumar

Hi,
My program is non-leaky, I've checked on that.
More virtual memory is allocated to it by the system then is required by it.
I'm filling a linked list which grows in size to around 1GB (at this point
the VM is around 2GB)
Pretty soon the 2GB limit is crossed and the program terminates.
Comparatively VC6 version is allocated less VM then the VS2005 version.
But still the 2GB limit is crossed.
Is there any compiler switch etc that could restrict this extra VM from
growing too much then is required?
Is there a way to free this VM dynamically?
Any solutions are welcome.

Navneet
 
Navneet said:
Hi,
My program is non-leaky, I've checked on that.
More virtual memory is allocated to it by the system then is required by it.
I'm filling a linked list which grows in size to around 1GB (at this point
the VM is around 2GB)
Pretty soon the 2GB limit is crossed and the program terminates.
Comparatively VC6 version is allocated less VM then the VS2005 version.
But still the 2GB limit is crossed.
Is there any compiler switch etc that could restrict this extra VM from
growing too much then is required?
Is there a way to free this VM dynamically?
Any solutions are welcome.

If you're working with these amounts of data, you're better off to use a
disk based linked list instead of trying to hold it all in memory. When
using large amounts of virtual memory, Windows gets EXTREMELY slow.
Google around and you'll find numerous articles on disk based data
structures

http://www.google.com/search?hs=z9b...al_s&q=Disk+based+data+structures&btnG=Search

Andrew Faust
 
Hi Navneet,

Most memory allocators don't cope well with progressively increasing
requests for memory. I imagine this is because they fail to consolidate
released memory. If your code does this then one possible workaround is to
precalculate the memory you will require and then ask for it in one hit.
Worth a try anyway.

Cheers
Doug Forster
 
Back
Top