lua-users home
lua-l archive

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


Sorry, I gave the wrong number.
Before gc sweep state, the totalbytes is 18.5G,
at the end of sweep state, totalbytes decrease to 11.5G.
So the GCDebt = 11.5 - 9.5G*0.9, 2.95G, also a big number.

>> The reason for this is that at the end of gc sweep, gcstate switch to pause,
>> [F] g->GCDebt = totalbytes - E * P / 100,
>> E:=g->GCestimate (memory traversed by the propagate state)
>> P:=g->gcpause (set by collectgarbage("setpause"))
>> Because traversetable() doesn't calculate the inner GCObject and nest
>> table's size,
>> so E is much less than totalbytes.
>> e.g. when there are 10k players online, the memory usage of my program
>> is quite high:
>> totalbytes:=18.5G, E:=9.5G, P:=90
>> according to formula [F], g->GCDebt is 9.95G, a big number.

> 9.95G is an abnormal large number for the GCdebt.
> Is there a bug in GC ? I don't think "traversetable() doesn't calculate the inner GCObject and nesttable's size" is the real reason.