Is CMAES optimizer working well?

Simbody is useful for internal coordinate and coarse grained molecule modeling, large scale mechanical models like skeletons, and anything else that can be modeled as bodies interconnected by joints, acted upon by forces, and restricted by constraints.
User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: Is CMAES optimizer working well?

Post by Jiang Ping » Sat Aug 08, 2015 12:04 am

Memory leak in Coordinate::_lockFunction (a ModifiableConstant)
https://github.com/opensim-org/opensim-core/issues/127

Fixed it!
Check if _lockFunction is empty before allocating the memory.
Attachment is the code.
Attachments
Coordinate.h
(12.83 KiB) Downloaded 43 times
Coordinate.cpp
(21.33 KiB) Downloaded 40 times

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Is CMAES optimizer working well?

Post by Christopher Dembia » Sun Aug 09, 2015 9:46 am

Hey Jiang:

Thanks for your enthusiasm. I looked at your code, and I don't see where you check if _lockFunction is null before allocating a new ModifiableConstant.

Sorry for the confusion, but this is one of the memory leaks that we *have* fixed, in the opensim-core repository. Here is the fix we used: https://github.com/opensim-org/opensim- ... /510/files.

If you are able to figure out some of the other ones, though, that would be excellent!

I'm aware of the leak in Delp1990Muscle_Deprecated and if you don't use this muscle then your fix is fine. However, in OpenSim we need an alternate fix that allows people to still use this class.

User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: Is CMAES optimizer working well?

Post by Jiang Ping » Wed Aug 12, 2015 6:04 am

hi,

Thank you very much for your information. Your memory leak fix for Coordinate.cpp also worked well for me.
I spent one week on locating where the code was hanging during the integration,
but unfortunately failed to find it. Finally, I created a win32 console application for my
objective function. And then created a child process to call it in each thread. Now the thread
is safe and optimizer works well.

And I also found another memory leak for CoordinateCoupledConstraint.cpp.
const SimTK::Function *f1 in class CompoundFunction was not released.

best regards,
jiang

POST REPLY