[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Doubt about gc's pause
- From: Enrico Colombini <erix@...>
- Date: Wed, 03 Jun 2009 11:14:07 +0200
From the manual:
[[The garbage-collector pause controls how long the collector waits
before starting a new cycle. Larger values make the collector less
aggressive. Values smaller than 100 mean the collector will not wait to
start a new cycle. A value of 200 means that the collector waits for the
total memory in use to double before starting a new cycle.]]
What I miss is: what is the reference value?
I thought this could work:
lua_gc(L, LUA_GCCOLLECT, 0);
lua_gc(L, LUA_GCSETPAUSE, 120);
but I seem to be able to allocate memory way beyond 120% of the memory
allocated before the collection, without starting an automatic gc cycle.
Looks like I don't understand how 'pause' works. I'm using Lua 5.1.2.