0

I have a program that repeatedly instantiates CyClpSimplex objects (ideally solving tens of thousands of LPs), but my kernel kills the program after ~6000 iterations. I think this is because of excessive memory usage (I'm in a docker container, and indeed hyperkit is currently using 2GB of RAM).

I'm not great at C++, and I have no experience in Cython (what much of CyLP is written in), but I suspect that these CyClpSimplex objects are not being deconstructed. I looked into the source and found that the cython CyClpSimplex class's __dealloc__ function is actually commented out! Does anyone know of a way to free this memory from within python? Am I totally off the mark in my understanding of this problem?

Battery_Al
  • 779
  • 1
  • 5
  • 20
  • https://stackoverflow.com/users/2320035/sascha – Battery_Al Aug 29 '17 at 01:32
  • you may be able to use del function. Also you can increase the default memory limit for you application. – Payman Aug 29 '17 at 01:53
  • I'm ashamed to admit I haven't yet tried just using del, but it's my understanding that python's garbage collector should be able to handle this. CyLP is a COIN-Clp wrapper though, so I'm afraid deleting the python object wouldn't delete the C++ object. Still trying del when I get home though. – Battery_Al Aug 29 '17 at 02:28
  • 1
    The missing `__dealloc__` function does look like a lot like a memoryleak. You could try uncommenting it (but they may have commented it out because of some other bug...). You would probably be better submitting a bug report rather than asking about it here. – DavidW Aug 29 '17 at 08:53

0 Answers0