On Mon, Aug 21, 2000 at 12:52:31PM -0400, Sarang Lakare wrote:
> Run a computationaly expensive code that needs around 1.5 Gb to work.. we
> have found that 
> 
> - using the exact same code (compiles both in gcc and VC++)
> - on the same machine
> - on the same input data
> 
> windows used 2.0 Gb and crashed (the m/c has 1.5 Gb + .5 Gb swap file) but
> Linux was running away to glory with mem usage of just 1.1 Gb.. and it
> finished our entire test with max mem usage of 1.7 Gb!!

Interesting, considering that neither NT nor W9x allow a process access to
a full 2 GB in user space. The precise details are in the SDK, but both
reserve a considerable chunk of memory for Mess-DOS compatibility, and then
more for OS cruft.

If you were running on NT, your swap file was set up incorrectly. You have
to have more swap space on disk than physical memory to get any advantage
for program data. Executables are swapped in and out from the executable
file, though. So to have enough swap space to support 2 GB of virtual
memory, you need at least a 2 GB swap file. Since neither NT nor W2K
support FAT32, that means you have to have your swap file on an NTFS
partition, which slows swapping a tad.

Also, if you used standard malloc, etc. for portability, you have a very
high memory overhead program. VC++ malloc is very wasteful of memory. I
would use other W32 specific virtual memory calls, and #def them out of
the Linux compile.

As for doing that sort of memory intense computation on W9x, forget it.

Have you tried compiling the code with the cygwin tools? Just curious.

-- 

                -- C^2

No windows were crashed in the making of this email.

Looking for fine software and/or web pages?
http://w3.trib.com/~ccurley

PGP signature

Reply via email to