[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Share proto object among multiple lua vm
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 20 Mar 2014 09:51:29 -0300
> 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