lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thank  you.
I think the overhead for shared library is "vmLib". "vmRSS" means the physical memory the process is using.
Am I right?


----- Original Message ----- 
From: "Mike Pall" <mikelu-0611@mike.de>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Tuesday, November 14, 2006 8:08 PM
Subject: Re: Lua need 1M memory?


> Hi,
> 
> jason zhang wrote:
>> I build a Lua5.1 interpreter in Linux, without any library. From the /proc/pid/status,
>> It show that the Lua interpreter use about 1M RSS memory. Is this the minimum memory usage of Lua?
> 
> No. You are counting libc, libm, libdl, /lib/ld overhead, too.
> And most of this is shared with other processes. Even the Lua
> part is mostly shared code/data. You can get the heap allocation
> with collectgarbage("count") (in Kilobytes).
> 
> You want to have a look at:
> 
>  # Shows the static code/data size:
>  size `which lua`
> 
>  # The first few lines are due to Lua, the rest is libc et al.
>  # The libc heap is usually overallocated and only a few K are committed.
>  lua -e 'os.execute("cat /proc/$PPID/maps")'
> 
> Summary:
> 
> * read-only (shared) code/data: 40K-200K, depending on compiler
>  options (-Os vs. -O3) and whether the parser is included.
>  This is for x86 code; somewhat more for most other (RISC) CPUs.
> 
> * read-write heap: 18K with standard libs, as low as 1K without.
> 
> Bye,
>     Mike
>