Skip to content

Instantly share code, notes, and snippets.

@tklein23
Last active December 27, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tklein23/7333816 to your computer and use it in GitHub Desktop.
Save tklein23/7333816 to your computer and use it in GitHub Desktop.
Output of `valgrind --leak-check=full python ./memleaking-apply_binary.py`
==14757== 200,000 bytes in 50,000 blocks are definitely lost in loss record 2,435 of 2,455
==14757== at 0x4C2CD7B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14757== by 0x9255CD6: operator new(unsigned long) (memory.cpp:103)
==14757== by 0x9275583: shogun::SGReferencedData::SGReferencedData(bool) (SGReferencedData.cpp:15)
==14757== by 0x9346BCD: shogun::SGSparseVector<double>::SGSparseVector() (SGSparseVector.cpp:9)
==14757== by 0x925B5F0: shogun::SGSparseVector<double>* shogun::sg_generic_malloc<shogun::SGSparseVector<double> >(unsigned long) (memory.cpp:422)
==14757== by 0x748DDC7: bool spmatrix_from_numpy<double>(shogun::SGSparseMatrix<double>&, _object*, int) (modshogunPYTHON_wrap.cxx:6769)
==14757== by 0x70C0D6F: _wrap_new_SparseRealFeatures__SWIG_2 (modshogunPYTHON_wrap.cxx:426582)
==14757== by 0x70C186B: _wrap_new_SparseRealFeatures (modshogunPYTHON_wrap.cxx:426782)
==14757== by 0x4AE24D: ??? (in /home/tklein/ipython-notebooks/ipy/bin/python)
==14757== by 0x47BF2A: PyEval_EvalFrameEx (in /home/tklein/ipython-notebooks/ipy/bin/python)
==14757== by 0x4E0489: PyEval_EvalCodeEx (in /home/tklein/ipython-notebooks/ipy/bin/python)
==14757== by 0x53FF11: PyEval_EvalCode (in /home/tklein/ipython-notebooks/ipy/bin/python)
#!/usr/bin/env python
import modshogun
import scipy.sparse
feat = modshogun.SparseRealFeatures(scipy.sparse.eye(50000, 50000, format='csc'))
del feat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment