This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cannot allocate >256 MB?


Hi,

I'm having trouble with a perl script under cygwin/perl that uses a lot
of memory.
Cygwin seems to blow up when allocating >256 MB.

1) At the moment memory allocation reaches apparently 256 MB
(virtual-memory size shown in the Win Task Mgr), the script terminates
with the message "Out of memory".
The machine has >1 GB physical memory and has successfully run other
programs with >256 MB memory usage.

2) After the above termination, the cygwin library has a hick-up:
 - a simple "ls" gives a seg fault
 - trying to open another rxvt window (while the shell in which the
script terminated is still open) shows the msg
    handle_exceptions: Exception: STATUS_ACCESS_VIOLATION

The hick-up can be fixed by exiting the shell (in which the script
terminated) first,
such that all cygwin processes are gone (and cygwin1.dll gets unloaded,
I guess).

Repro case (script and screen output) is included below.
For the repro case, the highest "VM Size" I see before it terminates was
230 MB.
In the real problem script, which grows memory more slowly, I see
VM-Size = 26x,xxx \approx 2^18.

Version info:
 - This is perl, version 5.005_03 built for cygwin32
 - WinNT Ver 5.0 build 2195 Service Pack 2
 - Cygwin DLL version info:
        dll major: 1003
        dll minor: 2
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 39
        shared data: 3
        dll identifier: cygwin1
        mount registry: 2
        cygnus registry name: Cygnus Solutions
        cygwin registry name: Cygwin
        program options name: Program Options
        cygwin mount registry name: mounts v2
        cygdrive flags: cygdrive flags
        cygdrive prefix: cygdrive prefix
        cygdrive default prefix: 
        build date: Sun May 20 23:28:17 EDT 2001
        shared id: cygwin1S3


(Does cygwin really have a limit of 256 MB!?!? Wouldn't that make it
kind of a toy?)

Thanks,

Frank


--- script to reproduce ("test.pl")

#!/usr/local/bin/perl

print STDERR "filling..";

$n = 2000000;
@proto[$n] = 0;
for ($i = $n; $i >= 0; $i--)
{
  if ($i % 100000 == 0) { print STDERR "."; }
  $proto[$i] = "acbdefghijklmnopqrstuvwxyz";
}
$m = 0;

print STDERR "\nduplicating...\n";

@a = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@b = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@c = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@d = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@e = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@f = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@g = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@h = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@i = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@j = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@k = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@l = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@m = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@n = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@o = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@p = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@q = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@r = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@s = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@t = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@u = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@v = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@w = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@x = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@y = @proto; ++$m; print STDERR  "$m\n"; sleep 1;
@z = @proto; ++$m; print STDERR  "$m\n"; sleep 1;


--- screen output

% ls -l
... (works correctly)
% ./test.pl
filling.......................
duplicating...
1
Out of memory!
% ls -l
Segmentation fault (core dumped)
%


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]