lua-users home
lua-l archive

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


>CPU usage can be monitored through HOOKCOUNT (which works for my
>purposes), however there doesn't appear to be any way to limit memory
>usage easily under the interpreter.

I see two ways of doing this without patching Lua:

1. In your count (or other) hook, call lua_getgccount and raise an error
   if too much memory is being used.

2. Recompile lmem.c to use your own memory allocator that refuses to allocate
   too much memory.

--lhf