OpenVZ Forum


Home » General » Support » High Virtual Memory Usage when loading shared libraries (Processes in the containers that load lots of shared objects have an extremely high virtual memory consumption)
High Virtual Memory Usage when loading shared libraries [message #38379] Sat, 12 December 2009 22:07 Go to next message
alamar is currently offline  alamar
Messages: 3
Registered: February 2009
Junior Member
Kernel:
Quote:
Linux version 2.6.24 (root@gw) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #4 SMP Thu Feb 19 04:36:29 CET 2009

Architecture: x86_64

(The program where I noticed this is inspire ircd (it uses lots of dynamically loaded modules) but I have the same issues with other programs that load lots of .so's as well. Also on a non-ovz system I don't see the problem described below)



Hi everybody,

I noticed a process using 300mb virtual memory looking at top in a container a while ago.
After doing a "pmap -x pid" it became apparent where the massive usage comes from.
The question/problem is that I can't understand why the size pmap shows is so big.

top:
Quote:
28665 inspircd 20 0 314m 11m 8352 S 0 1.2 0:00.32 inspircd


314m of virtual memory is way to much on non-ovz systems usage is about ~12m

small extract of pmap -x 28665
Quote:
[..]
00002b23d397a000 44 - - - r-x-- m_tline.so
00002b23d3985000 2044 - - - ----- m_tline.so
00002b23d3b84000 4 - - - rw--- m_tline.so
00002b23d3b85000 40 - - - r-x-- m_userip.so
00002b23d3b8f000 2044 - - - ----- m_userip.so
00002b23d3d8e000 4 - - - rw--- m_userip.so
[..]
---------------- ------ ------ ------ ------
total kB 321652 - - -



Now if I look for example at m_userip.so. On the harddisk the .so uses
Quote:
64K ./inspircd/modules/m_userip.so


00002b23d3b8f000 2044 - - - ----- m_userip.so


Where do the 2044k come from? And why are there no permissions?
This is the case with every .so file, and they don't dynamically (by using new/malloc) allocate this much memory.
About 300m of the 314m come from the 2044 or 2048 kb entries.

On non-ovz systems the line without the permissions is missing, I can't find any document explaining where this line would come from.
I thought maybe the 2044kb are the Virtual Page size but Virtual Page Size of the System is:
Quote:
getconf PAGESIZE
4096


Greets,

Julian

PS:
Sorry, in the meantime I noticed that it's more an architecture related problem and not due to openvz. If anybody knows why this happens on 64bit systems I'd still be glad to learn about it

[Updated on: Sat, 12 December 2009 22:45]

Report message to a moderator

Re: High Virtual Memory Usage when loading shared libraries [message #38430 is a reply to message #38379] Fri, 18 December 2009 15:47 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:

Sorry, in the meantime I noticed that it's more an architecture related problem and not due to openvz. If anybody knows why this happens on 64bit systems I'd still be glad to learn about it



do you mind to explain how you noticed that? This information may be helpful for other people.
Don't you think this behavior may depend on the kernel as well as the particular distributive (different distributives --> different shared libraries)?
You can have a try another kernel. I would recommend you using RHEL5 based one.
http://download.openvz.org/kernel/branches/rhel5-2.6.18/curr ent/
Previous Topic: Zimbra on OpenVz
Next Topic: return code -2 from vzctl
Goto Forum:
  


Current Time: Tue Dec 03 08:33:47 GMT 2024

Total time taken to generate the page: 0.21116 seconds