Messages in this thread | | | Date | Fri, 16 Jan 1998 14:17:10 -0800 (PST) | From | Xintian Wu <> | Subject | 2GB-Memory-Linux: Strange Behavior |
| |
After some tests, I discover the following:
Linux2.1.77 with the 2GB patch: Four jobs run well with 4 cpus if total memory doesn't exceed 1GB. Otherwise, one of the jobs will wait (Still in Running state with 0% cpu usage). The memory sum of the other three jobs is roughly 1GB.
So I upgrade the kernel to 2.1.78 with the 2GB patch: With 2.1.78, I am able to make all the cpus 99% usage. The calculation lasts the whole night, which makes me think the kernel is stable. However, I notice that (a) a single job seems to have a memory limit of 1GB, because I get memory allocation error when the VSZ on top figure shows roughly 900MB (in both mmap and shm cases). (b) swap space seems to be totally forgot by the system. (c) shm program needs to be re-compiled to work correctly under new kernel. (I didn't test this on mmap case)
The test program works like this: (a) share a 180MB file object (either use mmap or shared memory: 11*16M) (b) fork three children to have totally four jobs. (c) each job does tense computation, during which memory is allocated if needed.
PS: libc.so.5.4.38 with gcc-2.7.2.3.f.1
top figure for mmap case:
2:14pm up 2:48h, 4 users, load average: 4.10, 3.79, 3.32 37 processes: 32 sleeping, 5 running, 0 zombie, 0 stopped CPU states: 381.2% user, 17.7% system, 0.0% nice, 0.0% idle Mem: 2020188K av, 1132480K used, 887708K free, 111884K shrd, 14340K buff Swap: 130748K av, 0K used, 130748K free 210632K cached
USER PID %CPU %MEM NI VSZ RSS SHRD STAT TIME COMMAND xintian 1435 99.9 24.7 0 687M8 487M4 26132 R 3:29 PROG/SOURCE/SOUR xintian 1437 99.3 9.9 0 399M7 195M9 25924 R 3:22 PROG/SOURCE/SOUR xintian 1436 94.1 10.4 0 411M0 206M0 26408 R 3:24 PROG/SOURCE/SOUR xintian 1438 92.9 4.3 0 288M6 88264 25396 R 3:21 PROG/SOURCE/SOUR xintian 460 12.5 0.0 0 1492 652 468 R 17:05 /usr/bin/top
top figure for shared memory case:
1:59pm up 2:34h, 4 users, load average: 4.26, 3.64, 3.14 37 processes: 32 sleeping, 5 running, 0 zombie, 0 stopped CPU states: 341.2% user, 60.1% system, 0.0% nice, 0.0% idle Mem: 2020188K av, 1694400K used, 325788K free, 31168K shrd, 12868K buff Swap: 130748K av, 0K used, 130748K free 210624K cached
USER PID %CPU %MEM NI VSZ RSS SHRD STAT TIME COMMAND xintian 1281 99.9 36.6 0 924M0 723M7 5780 R 4:55 PROG/SOURCE/SOUR xintian 1284 98.6 4.6 0 293M9 94440 5160 R 4:43 PROG/SOURCE/SOUR xintian 1283 94.6 12.5 0 448M5 248M5 6200 R 4:44 PROG/SOURCE/SOUR xintian 1282 93.2 10.4 0 409M1 206M9 6000 R 4:46 PROG/SOURCE/SOUR xintian 460 14.5 0.0 0 1488 648 468 R 15:36 /usr/bin/top
| |