lua-users home
lua-l archive

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

On 05/01/2015 15:41, Roberto Ierusalimschy wrote:
First of all I run the test suites in the same process and printed
the value of collectgarbage 'count', with GC normally running:

I assume the numbering (1,2,3,...) is anchored in the program logic (that
is, they are related to fixed points in the computation), not in memory
conumption of something like that. If that is true, we only need the
very beginning of each trace to get into the problem:

The numbering is related to different test suites, one for each different module in my "patchwork" library.


So, certainly Lua 5.3 is eating much more memory (and wasting a lot of
time doing that), at some specific points of the program. The difference
persists with the GC rurned off; so, it seems that the problem is not
that 5.3 is not collecting garbage properly, but that it is *generating*
much more garbage in the first place.

What does you program do? What does it do between points 2 and 3?

Data point 3 is related to a simple "stack" module in OOP style and the test suite is relatively simple (no big loops over large datasets). Its only critical point may be a overly complicated constructor, since when I implemented it I was playing with OOP models and proxied objects, and it may generate some extra garbage.

I begin to suspect that the culprit is my home-made unit-testing framework, which is rather messy, and probably generates lots of garbage (many tricks to store arguments and returns of calls being tested plus support for a neater syntax when writing tests, so lots of garbage closures).

I must separate the concerns and see if reimplementing the tests in a more plain way tells me more about it (the unit-testing framework is a huge mess, and I'd like avoid dissecting it before knowing the problem is there).

I'll report back.

-- Roberto