lua-users home
lua-l archive

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


Hi,

I wish any of you on this list to reply about this problem.
Please tell me is this bug, or not? Is that case reproducable?
I'm afraid that my report may wrong in any way.

>  (1) GC "step" sometimes eat much CPU cycle than exepected, or even worse, 
>      infinitely loops under some situation.
>  (2) GC "step" doesn't return "end of cycle" flag sometimes, when it should.


Additionaly, I want to explain the background and another way to reproduce, 
about problem (2).

What I tried to do is to take total control of GC cycles. So, I wanted to obtain 
the count of executions of collectgarbage("step") to finish a GC cycle. 
By monitoring it, I could adjust the GC values on the fly. But with this "bug", 
sometimes I can't get the count reliably.

I experimented some other situations, the problem also happens 
on this GC settings.

collectgarbage("setpause", 150)
collectgarbage("setstepmul", 330)
collectgarbage("stop")

I attached the test script, and here is the output.
This is with LuaBinaries 5.1.3 Win32 build.

>lua5.1 test.lua
=====================================
collectgarbage("count") * 1024 = 24827 bytes
>>>>>>>>> create static data
collectgarbage("count") * 1024 = 38650 bytes
>>>>>>>>> GC step
step :  1       43533   bytes   diff:   4883    bytes
step :  2       49210   bytes   diff:   5677    bytes
step :  3       54071   bytes   diff:   4861    bytes
step :  4       58932   bytes   diff:   4861    bytes
step :  5       63772   bytes   diff:   4840    bytes
step :  6       64188   bytes   diff:   416     bytes
step :  7       56568   bytes   diff:   -7620   bytes
step :  8       48950   bytes   diff:   -7618   bytes
step :  9       50956   bytes   diff:   2006    bytes
cycle end. step count:  9
step :  10      55817   bytes   diff:   4861    bytes
step :  11      60679   bytes   diff:   4862    bytes
step :  12      65541   bytes   diff:   4862    bytes
step :  13      70382   bytes   diff:   4841    bytes
step :  14      75244   bytes   diff:   4862    bytes   #GC marking...
step :  15      80085   bytes   diff:   4841    bytes
step :  16      84926   bytes   diff:   4841    bytes
step :  17      89767   bytes   diff:   4841    bytes
step :  18      94608   bytes   diff:   4841    bytes
step :  19      94932   bytes   diff:   324     bytes
step :  20      87313   bytes   diff:   -7619   bytes
step :  21      74896   bytes   diff:   -12417  bytes   #GC sweeping...
step :  22      62480   bytes   diff:   -12416  bytes
step :  23      55824   bytes   diff:   -6656   bytes <---- there should be cycle-end around here
step :  24      60687   bytes   diff:   4863    bytes
step :  25      65549   bytes   diff:   4862    bytes
step :  26      70411   bytes   diff:   4862    bytes   #GC marking...
step :  27      70932   bytes   diff:   521     bytes
step :  28      63313   bytes   diff:   -7619   bytes
step :  29      50896   bytes   diff:   -12417  bytes   #GC sweeping...
step :  30      50960   bytes   diff:   64      bytes <---- also around here
step :  31      55820   bytes   diff:   4860    bytes
step :  32      60682   bytes   diff:   4862    bytes
step :  33      65544   bytes   diff:   4862    bytes
step :  34      70385   bytes   diff:   4841    bytes
step :  35      75247   bytes   diff:   4862    bytes
step :  36      80088   bytes   diff:   4841    bytes
step :  37      84929   bytes   diff:   4841    bytes
step :  38      89770   bytes   diff:   4841    bytes
step :  39      90132   bytes   diff:   362     bytes
step :  40      82513   bytes   diff:   -7619   bytes
step :  41      70096   bytes   diff:   -12417  bytes
step :  42      57680   bytes   diff:   -12416  bytes
step :  43      55824   bytes   diff:   -1856   bytes <---- also around here
step :  44      60687   bytes   diff:   4863    bytes
step :  45      65549   bytes   diff:   4862    bytes
step :  46      70411   bytes   diff:   4862    bytes
step :  47      70932   bytes   diff:   521     bytes
step :  48      63313   bytes   diff:   -7619   bytes
step :  49      50896   bytes   diff:   -12417  bytes
step :  50      50960   bytes   diff:   64      bytes <---- also around here
collectgarbage("count") * 1024 = 51020 bytes
collectgarbage("count") * 1024 = 36372 bytes
=====================================

So some of the end of GC cycle's are missing.


Any insights are appreciated.

Thanks,
Makoto Hamanaka 

Attachment: test.lua
Description: Binary data