Re: Memory limitation




"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.


.



Relevant Pages

  • RE: Virtual memory
    ... You can configure virtual memory in windows xp and thereby improve the ... How to set performance options in Windows XP ... if you have background programs such as printing or disk ... It is also known as the paging file. ...
    (microsoft.public.windowsxp.perform_maintain)
  • [NT] NNTP Service in Windows Contains Memory Leak
    ... NNTP Service in Windows Contains Memory Leak ... An affected server could be restored to normal service by ...
    (Securiteam)
  • Re: Physical Memory
    ... These Windows services are started: ... Memory optimizers/defragers are nothing more than snake ... These optimizers work by making demands on the Windows Memory Manager ... The funny thing about all of this nonsense is that the snake oil memory ...
    (microsoft.public.windowsxp.general)
  • Re: Slow performance
    ... computer has two memory slots so to achieve 1 gb you need to install 2 x ... own set up consists of AVG 8 Anti-Virus, Spybot S& D, Windows Defender ... of programme is generally not recommended in these newsgroups. ... My disk drive is pretty full right now, mainly due to fact that I just ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: memory requirements of closed vs quit apps
    ... majority of programs remain open when all their windows are closed. ... they use bugger all memory - and are ... individual apps Real and Virtual memory entries. ... In order to push it out to swap, ...
    (uk.comp.sys.mac)