lua-users home
lua-l archive

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


张伟智 <robotkzhang@gmail.com>于2016年9月27日周二 下午5:02写道:

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 nest
table's size" is the real reason.