LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Vsz memory size (https://www.linuxquestions.org/questions/linux-kernel-70/vsz-memory-size-760461/)

balainemb 10-07-2009 11:55 PM

Vsz memory size
 
I need a clarification in (Vsz)(virtual)Memory size. I have compiled a code.
on both 2.4 and 2.6 kernel based machine i386.
#include <stdio.h>
int main()
{
while(1)
seleep(1);
}

I have checked the size of the Vsz size in the 2.4 and 2.6 based machine. There is a huge difference. at first sight i could see the library versions are different but it should not create a huge difference.

I will paste the output of pmaps here in 2.4 and 2.6
below.
(Pmap o/p in 2.4)
08048000 (4 KB) r-xp (03:03 405625) /home/guest/bselvara/a.out
08049000 (4 KB) rw-p (03:03 405625) /home/guest/bselvara/a.out
40000000 (84 KB) r-xp (03:02 309509) /lib/ld-2.3.2.so
40015000 (4 KB) rw-p (03:02 309509) /lib/ld-2.3.2.so
40016000 (4 KB) rw-p (00:00 0)
40034000 (1228 KB) r-xp (03:02 309516) /lib/libc-2.3.2.so
40167000 (16 KB) rw-p (03:02 309516) /lib/libc-2.3.2.so
4016b000 (8 KB) rw-p (00:00 0)
bfffe000 (8 KB) rwxp (00:00 0)
mapped: 1360 KB writable/private: 44 KB shared: 0 KB


Pmap O/p in 2.6
0024c000 (88 KB) r-xp (fd:00 29295475) /lib/ld-2.3.4.so
00262000 (4 KB) r--p (fd:00 29295475) /lib/ld-2.3.4.so
00263000 (4 KB) rw-p (fd:00 29295475) /lib/ld-2.3.4.so
00266000 (1176 KB) r-xp (fd:00 29295492) /lib/tls/libc-2.3.4.so
0038c000 (8 KB) r--p (fd:00 29295492) /lib/tls/libc-2.3.4.so
0038e000 (8 KB) rw-p (fd:00 29295492) /lib/tls/libc-2.3.4.so
00390000 (8 KB) rw-p (00:00 0)
08048000 (4 KB) r-xp (00:29 2558191) /users/bselvara/test/a.out
08049000 (4 KB) rw-p (00:29 2558191) /users/bselvara/test/a.out
b7f56000 (4 KB) rw-p (00:00 0)
bfec6000 (1256 KB) rw-p (00:00 0)
ffffe000 (4 KB) ---p (00:00 0)
mapped: 2568 KB writable/private: 1284 KB shared: 0 KB



If i compare both the o/p ther is a difference of 1208 kb.

can any one please explain what is Vsz. Why is the difference.
How they calculate Vsz?

Iam facing same scenario in my project. initially on the project was running on 2.4 kernel and the vsz size occupied by the thread is just 20Mb now the same code adapted for powerpc arch with 2.6 kernel the size of vsz of the thread is 120 MB(approx). can some one explains why there is a huge increase in Vsz. Thanks in advance

regards,
Balamurugan
newbie


All times are GMT -5. The time now is 12:25 AM.