[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua need 1M memory?
- From: "jason zhang" <jzhang@...>
- Date: Wed, 15 Nov 2006 09:17:18 +0800
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" <firstname.lastname@example.org>
To: "Lua list" <email@example.com>
Sent: Tuesday, November 14, 2006 8:08 PM
Subject: Re: Lua need 1M memory?
> 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")'
> * 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.