Re: Memory limitation
- From: "Terry Russell" <trochilus@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Oct 2006 11:56:23 +0930
"Gilles Rosselet" <gilles.rosselet@xxxxxxx> wrote in message
news:1161869678_122@xxxxxxxxxxxxxxxxxxx
Two examples recently made me wonder if there is a limitation on the
maximum of memory a program can use:
The first one is a program I've written in Delphi. It deals with matrices
each of them using about 280MB of memory. If I create only 3 of them
everything works fine, but when I create a forth one my program crash.
The 2nd example is a commercial FEM program (Flux2D by Cedrat). It allows
its user to set the maximum amount of memory it can use. If I set it above
1GB, it crashes.
So, does Delphi or Windows XP put a limit to the amount of memory a single
program can use?
As mentioned there are limits in the low gigabytes, also depending on what
other apps lock and how much swap the user allows.
The process space will also rapidly run out as it fragments.
Once approaching these limits you run into windows spending long and
unpredictable
delays thrashing swap file. This affects other programs and is only a short
step before
you run out of windows memory space entirely.
You should start to manage large chunks of memory yourself. You can look at
file mapping but the simplest is to roll a class that does your own paging
from
file(s) to a static memory block. The exact weighting of buffers and size ,
dirty
pages writing and such depends on what access patterns you anticipate.
Normal variables and the page blocks exist in windows space but you have
all
the hd to play with as a virtual address.
A paging lookup and file read on every 'memory' access may seem wasteful ,
it slows in-memory access by a factor of 4 or worse but once you start to
hit the disk
it is doing what windows does without the random decisions and thrashing on
what
to swap out, assuming you are the prime cpu hog you decide whats needed and
not.
If you need gigabyte chunks now you will need terabytes in a few years, you
may as well
do it now and get on with doing the useful stuff.
A 64bit 'address' space index 16 million teraitems, nothing says the address
has to point to a byte.
It is also useful , with appropriate helpers, if you are manipulating very
sparse arrays.
.
- References:
- Memory limitation
- From: Gilles Rosselet
- Memory limitation
- Prev by Date: Re: Memory limitation
- Next by Date: Re: Memory limitation
- Previous by thread: Re: Memory limitation
- Index(es):
Relevant Pages
|