memory leak in Law2...Capillarity

Bug #995874 reported by Christian Jakob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Undecided
Unassigned

Bug Description

I detected a memory leak in the capillary model. When running several millions of steps (after ca. 2 days calc. time) my RAM is full (Note, that I have 32 GB, which should be enough for 600 particles ;) and swap also begin to fill.
In line 91 of capillary model there is a comment:

// /*if (b1 and b2)*/ {// FIXME: possible memory leak here?

So this gives me the hint, that the leak is not on python-script side but on C++ side.

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote : Re: [Yade-dev] [Bug 995874] [NEW] memory leak in Law2...Capillarity

I added the fixme when I saw how the original law add been "hacked" to
avoid crash after bodies removal, that is true.
OTOH, this "if (b1 && b2)" is now commented, so it cannot cause the leak.

There is no "new" operator in the code (well, there is one but it's in a
shared ptr, harmless), so it must be a vector which is pushed_back and
not always cleaned.
I suspect fusion detection not perfectly handling your recent changes
for deleting bridges and bodies.

Consider this:
line 77: if ((*ii)->isReal()) {
                        ...
line 124: cundallContactPhysics->meniscus=true;
line 176: } else /*not real*/ if (fusionDetection)
bodiesMenisciiList.remove((*ii));

Now, what happens if the interaction is Real, then deleted?... It will
never be removed from the list.
I would double check this sort of situation, and try and find a vector
whose size is growing.
I don't know precisely what has been implemented recently and how it is
used, so I can't guess more.

Bruno

Changed in yade:
status: New → Fix Committed
Changed in yade:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.