Skip to contentSkip to conversation

memory usage between kernel versions

DISCUSSION Mike Harless 2 participants 3 messages Nov 14, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I've got an embedded product that is currently using a 3.14 kernel, with all user apps compiled with gcc 4.9 against that kernel. When I replace the 3.14 kernel with a 4.9 kernel, and leave everything else the same on the product, I see my memory available drop by over 10MB when looking at /proc/meminfo. The size difference between the 3.14 and 4.9 kernels is only about 1MB, so I'm trying to figure out where the rest went, and if I've possibly configured somehting in the 4.9 kernel differently that's causing the change.

Looking at smaps files for various processes, I'm seeing some Rss differences when some common libraries are loaded and I'm wondering if it's really different, or just different accounting/fetching. For instance, with libc and the same process with both kernels:

3.14 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 416 kB
Pss:                  12 kB

4.9 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 768 kB
Pss:                  12 kB

Is this difference in Rss something to keep looking into, or are there other thoughts or suggestions on where to look? Thanks!

--Mike

#1 lore raw
Quoted 6 lines · Mike Harless

3.14 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 416 kB
Pss:                  12 kB
Quoted 8 lines

4.9 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 768 kB
Pss:                  12 kB

Is this difference in Rss something to keep looking into, or are there other thoughts or suggestions on where to look? Thanks!

Looks identical to me except for the RSS - which is the amount of resident memory consumed. And *that* can be an artifact of when the process was started, what order processes were started, how many of its pages had been referenced, whether the kernel does read-ahead of .so text segments, and any number of other things. It may be as simple as "you checked the 3.14 system when it had been up for several days/weeks/months and all the useless parts of libc had been freed (to be re-fetched from disk if referenced), and you checked the bright shiny new 4.9 kernel right after boot, before memory pressure had caused page frees to happen.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20171114/a001f6d5/attachment.bin

#2 lore raw
Quoted 17 lines · valdis.kletnieks at vt.edu
Quoted 6 lines · Mike Harless

3.14 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 416 kB
Pss:                  12 kB
Quoted 8 lines

4.9 kernel:
4c010000-4c0d0000 r-xp 00000000 00:0e 1177 /lib/libc-2.20-2014.11.so

Size:                768 kB
Rss:                 768 kB
Pss:                  12 kB

Is this difference in Rss something to keep looking into, or are there other thoughts or suggestions on where to look? Thanks!

Quoted 9 lines

Looks identical to me except for the RSS - which is the amount of resident memory consumed. And *that* can be an artifact of when the process was started, what order processes were started, how many of its pages had been referenced, whether the kernel does read-ahead of .so text segments, and any number of other things. It may be as simple as "you checked the 3.14 system when it had been up for several days/weeks/months and all the useless parts of libc had been freed (to be re-fetched from disk if referenced), and you checked the bright shiny new 4.9 kernel right after boot, before memory pressure had caused page frees to happen.

These were both checked right at startup once the product got to "idle", and have been consistent in a number of tests. Is there a configuration for read-ahead of .so text segments in the 4.9 kernel? That sure seems to be what I'm seeing here in this case with Rss. That could explain some of the difference in memory available too.

--Mike