Too much memory used at creation/removal of interactions ? (JCFpm)

Bug #1273775 reported by Jérôme Duriez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Undecided
Unassigned

Bug Description

Hi,

The problem is described here : https://answers.launchpad.net/yade/+question/242890

I'm attaching the script describing this simple compression, with the .spheres file (in a 2d comment) that is loaded to "ymport" the sample. In this script/in the on-line yade version, the number of interactions that were requested to erase, despite a geometrical overlap, is not accessible.

Let me know if I forgot something to let run the simulation.

Jérôme

Revision history for this message
Jérôme Duriez (jduriez) wrote :
Revision history for this message
Jérôme Duriez (jduriez) wrote :

The .sphere file

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Thanks for reporting. Could you check if the following replacement fix the problem?

scene->interactions->requestErase(contact->getId1(),contact->getId2());
====>
scene->interactions->requestErase(contact);

I don't know if I failed some search/replace or if it has been commited afterward, but the (id1,id2) form should not be used after [1] (two years ago).

Even if it fixes your problem, please don't close the bug. It should be simply impossible to write leaking code. The mechanism of queuing pending erase has been removed, but this nasty function filling the queue are still there... my mistake.

Besides, you can't really erase interactions when they overlap. They will effectively be created then reset at each step (but without the memory leak). It would be better to not erase in terms of performance. Plus, I don't understand how you can decide to ignore them if you erase them: history is lost, in the next iteration they look new.

Bruno

https://github.com/yade/trunk/commit/15182aca8473be86c74b139731dbb88b0007f759

Revision history for this message
Jérôme Duriez (jduriez) wrote :

It solves the memory problem !

The JCF model was surely only on Luc's PC when you did this commit, and then the use of requestErase(id1,id2) was re-introduced when JCF code was commited after.

I'll commit the change in JCFpm soon, but why not erasing this (id1,id2) version from InteractionContainer ? I noticed these different versions, but could not deduce directly that there was right and wrong ones...

For the question of erasing or not such interactions in JCFpm, I agree with you. Probably this will change after some discussion with other users. (but I don't think there might be another problem than performance : such interactions will have Fn=Ft=0 at their re-birth)

Revision history for this message
Jérôme Duriez (jduriez) wrote :
Changed in yade:
status: New → Fix Committed
Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

"please don't close the bug" -> reopening.

Changed in yade:
status: Fix Committed → Confirmed
Revision history for this message
Jérôme Duriez (jduriez) wrote :

Hi Bruno,

Is it this change https://github.com/yade/trunk/commit/a9d7963ff501c4ac873564094e4a47f5bf8a3b5f that you had in mind before closing the bug ?

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Absolutely.
Closing :)

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