lua-users home
lua-l archive

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


> There are many lua vm (more then 10K) in one process in our system. We
> run all of them by a thread pool. It runs well except huge memory
> usage , because the same byte codes exist in each vm .
> 
> So I make a patch to lua 5.2.3 to share the same Proto objects among
> multiple lua vm [1].

Are you really sharing the Proto object or only the bytecode (and maybe
some other fields)? If you are sharing the Proto object, how to you
handle its constants (field 'k')? They include strings, and short strings
cannot be shared (at least directly), due to internalization.

-- Roberto