lkml.org 
[lkml]   [1998]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwhat's the limit ?
why does the small C program below crash in the 2nd line of main()
on a Linux 2.0.33/35 with 512M memory and almost all memory free ?

-------------------------------------------------------------------------------
# free
total used free shared buffers cached
Mem: 515644 35804 479840 19068 4676 16000
-/+ buffers: 15128 500516
Swap: 130748 0 130748
#
# gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.1/specs
gcc version 2.7.2.1
-------------------------------------------------------------------------------
struct {
int kd1[2];
char ab[256 * 1024 * 1024];
int kd2[2];
} chol;

main(int i)
{
chol.kd1[0] = 0;
chol.kd2[0] = 0;
}
-------------------------------------------------------------------------------


sometimes the size of array ab[] in the structure can be ~250M before crashing,
sometimes only ~200-210 MB, on a PC with 128M ram + 128M swap we typically
hit a limit of ~180M even if much more virtual space (ram+swap) is free.

what am I missing, which limit are we hitting ?


Harald
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.035 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site