lua-users home
lua-l archive

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


On Wed, Nov 22, 2006 at 05:18:42PM -0800, Sam Roberts wrote:
> On the other hand, maybe it doesn't matter  that the heap is large, the
> pages will get swapped out, and if you never touch them, who cares?

You're going to touch them the next time you allocate more memory, and
the swapper--not knowing that memory was stale--will swap the old data
back in; whatever the user is doing that needs that memory will be
blocked while that happens.  I care if applications are wasting my
system's performance by increasing swap file activity.

By the way, it might be possible to improve Lua's memory use by having
the allocation function use a C++ allocator.  Knowing the size on
deallocation can give better characteristics than malloc/free can do,
especially for small allocations (eg. 4-byte allocations that really use
4 bytes).  I don't know if it would have an appreciable impact on total
memory use by Lua.

-- 
Glenn Maynard