-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list of memory leaks #170
Comments
We have no reason to think the leak is not legit. We can comb through https://gist.github.com/chrisdembia/8e2201c50d68f3b2f344 to find the main culprit, since @carmichaelong was seeing similar issues. |
I spent some time trying to fix that SimmSpline leak, but did not succeed. |
There's also a leak in Joint's. |
For my case, I've been building 64bit with 2013Pro. |
I'm building 32 bit using VisualStudio 2013 Pro (on 64 bit machines). |
which SimmSpline and Joint leak? It may be the case that it just barely passes in 64bit. It is worth patching known leaks. I can try to tackle the leaks @chrisdembia if you can point me to them. |
|
More info: the opensim-core/OpenSim/Common/ArrayPtrs.h Line 396 in ba13c7d
Here is the sequence of calls:
|
Here's a leak in creating the AssemblySolver: https://github.com/opensim-org/opensim-core/blob/master/OpenSim/Simulation/Model/Model.cpp#L1542 The items in the coordsToTrack array are deleted but the array itself is not deleted: https://github.com/opensim-org/opensim-core/blob/master/OpenSim/Simulation/AssemblySolver.cpp#L76 |
I'm filing a separate issue for the assembly solver bug. |
@chrisdembia taking one leak at a time, does testInitState fail/leak due to SimmSpline? or should I make a commit with [ci valgrind] to rerun and comb thru output? Do you have a link to the latest valgrind output? |
I think so, looking at the link below.
it's only on my fork so far: https://travis-ci.org/chrisdembia/opensim-core/jobs/32566411#L3592 |
You should be able to use the link above for now. |
I can see it now, and I don't think t's the SimmSpline since this happens in the call stack of RegisterType which happens once per loading the dll. It is the AssemblySolver leak, I fixed it and the case passes on windows now but now testIK dies and I'm investigating. Thanks for the link @chrisdembia |
For tracking purposes, I think it would be easier to create separate issues. Otherwise this one might always be open .... @aymanhab could you make appropriate issues for confirmed leaks and we can prioritize appropriately? |
@jenhicks I will list what was reported by valgrind. |
The reason why we currently do not use travis to detect memory leaks is that we already have a bunch of leaks. However, it is possible to suppress specific errors with valgrind:
This would allow us to use valgrind to check for leaks on travis. |
With latest fixes verified by @fcanderson this can be put to rest finally |
The test case testInitState filas on Windows (2013 Pro) with error log below. Need to either plug leak if true, or relax condition if this's not true so that developers have confidence in their environment. The test case passes on Travis,
...
Loaded model arm26 from file arm26.osim
*********************** testMemoryUsage ***********************
MODEL: arm26.osim uses 136KB
156KB change in memory use after 100 state initializations.
Approximate leak size: 1.55957KB or 1.14674% of model size.
Average initialization time: 0.66ms
testInitState failed:
Exception:
testMemoryUsage: state initialization leak > 0.5% of model memory
footprint.
file= C:\Users\Ayman\Documents\GitHub\opensim-core\OpenSim\Simulation\Test\testInitState.cpp
line= 195
The text was updated successfully, but these errors were encountered: