For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > May 2006 > restrict growing VM of a process









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author restrict growing VM of a process
Navneet Kumar

2006-05-25, 8:13 am

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


Andrew Faust

2006-05-25, 7:05 pm

Navneet Kumar wrote:
> 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...res&btnG=Search

Andrew Faust
Doug Forster

2006-05-25, 7:05 pm

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

"Navneet Kumar" <navneet.1971@gmail.com> wrote in message
news:%23C1%23Cd%23fGHA.5104@TK2MSFTNGP04.phx.gbl...
> 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
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com