Slow leak in Argus iBuffer::getMetadata()?

We are seeing what looks like a sub-linear memory growth from progressive calls to iBuffer::getMetadata(). Is this expected and how do we avoid it?

An outline of our code is as follows:

  1. A fixed number of calls to IBufferOutputStream::createBuffer
  2. A loop of IBufferOutputStream::acquireBuffer, Argus::interface_cast<Argus::IBuffer>, IBuffer::getMetadata, IBufferOutputStream::releaseBuffer

First, thank you for the report of still-living, leaked objects that Argus produces when the process exits. If we release the IBuffer objects, there are no leaks reported. But, if we intentionally do not release them, there is an interesting progression of live objects over time:

  • After 100 frames captured, 60-70 objects are live.
  • After 1,000 frames, 100-200 objects.
  • After 10,000 frames, 250-300.
  • After 100,000 frames, roughly 500 live objects.

I would expect the object count to be roughly solid-state after the first few frames. If we do not call getMetadata, the object count does not increase. How do we access metadata without the memory growth?


Why don’t you intentionally release them?

During execution of the long-running program, the buffers are created once on startup and reused until being released on shutdown. The fact that everything will be properly released on shutdown is not interesting. What is concerning is the peak object count during execution and why it continues to grow when we would expect it to be static.

So, intentionally not releasing the buffer is only done as a test to measure the peak object count.

The question remains: Why is getMetadata() slowly increasing the object count even though it’s interface indicates that it should not?

How do you check the problem?

Run the program for N frames, then let it exit. Check the still-live report Argus gives on exit.

If we do getMetadata every frame, the live object count goes up slowly as listed above. If we don’t getMetadata, the count does not go up.

How to check the still-live object?

When a process that uses Argus exits, Argus prints a report of how many Argus objects are still live.