-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Memory leak in InternalThread::StartInternalThread() #1316
Comments
Good point -- |
Thanks for your reply. How about this line
Isn't this also leaking? |
Yup, looks like a memory leak as well.
Not sure...this is my first time looking at all this code; seems it could use a good round of cleanups... (please feel free to send a PR). |
@ryotat thanks for the close look and catching these issues! A fix is certainly in order, so a PR would be welcome! |
hmmm, I think I fixed this but I still have a problem that the amount of memory consumed by caffe increases linearly with the number of iterations. Is this a normal behavior? I was looking at the output of valgrind and found the above leak. My issue might be related to this, but I am having the issue with both leveldb and LMDB. |
After applying the fix suggested by ryotat, I still notice a leak on the latest master branch, supporting ryotat's observation that this may be a more complex leak. caffe memory usage increases on each iteration linearly, reaching tens of gigabytes and beyond. The problem appears to be related to this line: https://github.com/BVLC/caffe/blob/master/src/caffe/layers/data_layer.cpp#L167. If I comment it out, memory remains mostly constant. However, I find it very difficult to believe that this is a bug is due to Google's protobuf library! |
Thanks for confirming my observation. It would be great if somebody with a better understanding of how protobuf / LMDB works could look into this. |
Thread leak fixed by #1335. |
I think the following line
is causing a memory leak because this function is called every time BasePrefetchingDataLayer::Forward_cpu() is called and the allocated memory is not freed.
The text was updated successfully, but these errors were encountered: