InsertionSortCollider memory leaks

Bug #721107 reported by Sergei Dorofeenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Status tracked in Trunk
0.60
Fix Released
Undecided
Unassigned
Trunk
Fix Released
High
Unassigned

Bug Description

If add a particles after start a simulation, InsertionSortCollider's memory leak occurs.
If set verletDist=0 in ISC, no memory leak.

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :
Changed in yade:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Anton Gladky (gladky-anton) wrote :

Seems, it is not quite proper way to load particles.

Please, check an attached script with PyRunner and close the bug if it solves the problem for you.?field.comment=Seems, it is not quite proper way to load particles.

Please, check an attached script with PyRunner and close the bug if it solves the problem for you.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Anton, whatever Yade lets you do is a proper way of using it. Why is it not "proper"?

Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 721107] Re: InsertionSortCollider memory leaks

Still leaks.

Anton

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :
Download full text (5.3 KiB)

Valgrind reports about problems with InsertionSortCollider::handleBoundInversion. All memory leak from this function, as seems. May be something is wrong with creating of the interactions for the new particles?

Valgrind report:
--------------------------------------------------------------------------------
  n time(i) total(B) useful-heap(B) extra-heap(B) stacks(B)
--------------------------------------------------------------------------------
 47 74,791,217,242 854,819,752 735,410,607 119,409,145 0
86.03% (735,410,607B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->33.37% (285,212,808B) 0x192CC889: InsertionSortCollider::handleBoundInversion(int, int, InteractionContainer*, Scene*) (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
| ->33.37% (285,212,808B) 0x192CE9AD: InsertionSortCollider::action() (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
| ->33.37% (285,212,808B) 0xFB86C02: Scene::moveToNextTimeStep() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->33.37% (285,212,808B) 0xFB8796A: SimulationFlow::singleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->33.37% (285,212,808B) 0xFB80B3F: ThreadWorker::callSingleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->33.37% (285,212,808B) 0xFB844F6: ThreadRunner::call() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->33.37% (285,212,808B) 0xFB84572: ThreadRunner::run() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->33.37% (285,212,808B) 0x8B31A52: boost::function0<void>::operator()() const (in /usr/lib64/libboost_python.so.1.39.0)
| ->33.37% (285,212,808B) 0x7B2500E: thread_proxy (in /usr/lib64/libboost_thread.so.1.39.0)
| ->33.37% (285,212,808B) 0x51B665B: start_thread (pthread_create.c:297)
| ->33.37% (285,212,808B) 0x5AF8ECB: clone (clone.S:112)
|
->12.20% (104,301,400B) 0xFB80F4C: InteractionContainer::insert(boost::shared_ptr<Interaction> const&) (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0x192CC8B2: InsertionSortCollider::handleBoundInversion(int, int, InteractionContainer*, Scene*) (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
| ->12.20% (104,301,400B) 0x192CE9AD: InsertionSortCollider::action() (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
| ->12.20% (104,301,400B) 0xFB86C02: Scene::moveToNextTimeStep() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0xFB8796A: SimulationFlow::singleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0xFB80B3F: ThreadWorker::callSingleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0xFB844F6: ThreadRunner::call() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0xFB84572: ThreadRunner::run() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
| ->12.20% (104,301,400B) 0x8B31A52: boost::function0<void>::operator()() const (in /usr/lib64/libboost_python.so.1.39.0)
| ...

Read more...

Revision history for this message
Anton Gladky (gladky-anton) wrote :
Download full text (5.9 KiB)

I have discovered, that the number of iterations is getting larger and
larger during leak.
Also a simulation freezes.

Anton

On Fri, Feb 18, 2011 at 2:31 PM, Sergei Dorofeenko <email address hidden> wrote:
> Valgrind reports about problems with
> InsertionSortCollider::handleBoundInversion. All memory leak from this
> function, as seems. May be something  is wrong with creating of the
> interactions  for the new particles?
>
> Valgrind report:
> --------------------------------------------------------------------------------
>  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
> --------------------------------------------------------------------------------
>  47 74,791,217,242      854,819,752      735,410,607   119,409,145            0
> 86.03% (735,410,607B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
> ->33.37% (285,212,808B) 0x192CC889: InsertionSortCollider::handleBoundInversion(int, int, InteractionContainer*, Scene*) (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
> | ->33.37% (285,212,808B) 0x192CE9AD: InsertionSortCollider::action() (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
> |   ->33.37% (285,212,808B) 0xFB86C02: Scene::moveToNextTimeStep() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |     ->33.37% (285,212,808B) 0xFB8796A: SimulationFlow::singleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |       ->33.37% (285,212,808B) 0xFB80B3F: ThreadWorker::callSingleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |         ->33.37% (285,212,808B) 0xFB844F6: ThreadRunner::call() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |           ->33.37% (285,212,808B) 0xFB84572: ThreadRunner::run() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |             ->33.37% (285,212,808B) 0x8B31A52: boost::function0<void>::operator()() const (in /usr/lib64/libboost_python.so.1.39.0)
> |               ->33.37% (285,212,808B) 0x7B2500E: thread_proxy (in /usr/lib64/libboost_thread.so.1.39.0)
> |                 ->33.37% (285,212,808B) 0x51B665B: start_thread (pthread_create.c:297)
> |                   ->33.37% (285,212,808B) 0x5AF8ECB: clone (clone.S:112)
> |
> ->12.20% (104,301,400B) 0xFB80F4C: InteractionContainer::insert(boost::shared_ptr<Interaction> const&) (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> | ->12.20% (104,301,400B) 0x192CC8B2: InsertionSortCollider::handleBoundInversion(int, int, InteractionContainer*, Scene*) (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
> |   ->12.20% (104,301,400B) 0x192CE9AD: InsertionSortCollider::action() (in /home/sega/YADE/lib/yade-trunk/plugins/libplugins.so)
> |     ->12.20% (104,301,400B) 0xFB86C02: Scene::moveToNextTimeStep() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |       ->12.20% (104,301,400B) 0xFB8796A: SimulationFlow::singleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |         ->12.20% (104,301,400B) 0xFB80B3F: ThreadWorker::callSingleAction() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |           ->12.20% (104,301,400B) 0xFB844F6: ThreadRunner::call() (in /home/sega/YADE/lib/yade-trunk/lib/libcore.so)
> |             ->1...

Read more...

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :

Hm... If I add one particle and run 100 iters, then add 10 particles and run 1 iter I have body 8 with wrong bound AABB. Seems, it is a cause of a very large amount of a ghost interacitons.

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :

Cause is that velocityBins->bodyBins is resized (in InsertionSortCollider.cpp, line 216) _after_ having been used in BoundDispatcher::action, line 47. Therefore, for added particles used a garbage value of sweep.

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :

Vaclav, could not you to check it? I need this feature, but I do not want to modify this code, because I do not know it in detail. Thanks!

Revision history for this message
Sergei Dorofeenko (sergei.dorofeenko) wrote :

Fix commited in bzr2749. Is it a good solution?

Changed in yade:
status: Confirmed → Fix Committed
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.