aravindhv10 opened a new issue #13437: Memory leak in c++ api
URL: https://github.com/apache/incubator-mxnet/issues/13437
 
 
   I am using the c++ api mxnet, I have attached the program. There seems to be 
significant memory leak due to the line "exec->Backward();", am I doing 
anything wrong (valgrind shows the memory leak is due to calls in opencv but I 
have not included or used any of the opencv functions here) ?
   
   (please check the attachment for the program "program.cpp")
   
   ## Description
   Memory leak when using c++ api.
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   ('Version      :', '2.7.15')
   ('Compiler     :', 'GCC 7.3.0')
   ('Build        :', ('default', 'May  1 2018 05:55:50'))
   ('Arch         :', ('64bit', 'ELF'))
   ------------Pip Info-----------
   ('Version      :', '9.0.1')
   ('Directory    :', '/usr/lib/python2.7/dist-packages/pip')
   ----------MXNet Info-----------
   ('Version      :', '1.4.0')
   ('Directory    :', 
'/usr/local/lib/python2.7/dist-packages/mxnet-1.4.0-py2.7.egg/mxnet')
   Hashtag not found. Not installed from pre-built package.
   ----------System Info----------
   ('Platform     :', 'Linux-4.16.0-2-amd64-x86_64-with-debian-buster-sid')
   ('system       :', 'Linux')
   ('node         :', 'mint')
   ('release      :', '4.16.0-2-amd64')
   ('version      :', '#1 SMP Debian 4.16.16-2 (2018-06-22)')
   ----------Hardware Info----------
   ('machine      :', 'x86_64')
   ('processor    :', '')
   Architecture:        x86_64
   CPU op-mode(s):      32-bit, 64-bit
   Byte Order:          Little Endian
   CPU(s):              8
   On-line CPU(s) list: 0-7
   Thread(s) per core:  2
   Core(s) per socket:  4
   Socket(s):           1
   NUMA node(s):        1
   Vendor ID:           GenuineIntel
   CPU family:          6
   Model:               94
   Model name:          Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
   Stepping:            3
   CPU MHz:             1756.210
   CPU max MHz:         4000.0000
   CPU min MHz:         800.0000
   BogoMIPS:            6816.00
   Virtualization:      VT-x
   L1d cache:           32K
   L1i cache:           32K
   L2 cache:            256K
   L3 cache:            8192K
   NUMA node0 CPU(s):   0-7
   Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx 
pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl 
xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 
monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 
x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 
3dnowprefetch cpuid_fault invpcid_single pti ibrs ibpb stibp tpr_shadow vnmi 
flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid 
rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves 
dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0327 
sec, LOAD: 1.3881 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0073 sec, LOAD: 
1.7587 sec.
   Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 0.0299 sec, LOAD: 1.6151 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0663 sec, 
LOAD: 0.4510 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0650 sec, LOAD: 
1.4747 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0807 sec, LOAD: 
1.1193 sec.
   ```
   
   Package used (Python/R/Scala/Julia):
   c++ symbol api of mxnet.
   
   ## Build info (Required if built from source)
   
   Compiler (gcc/clang/mingw/visual studio):
   GCC 7.3.0
   
   MXNet commit hash:
   (Paste the output of `git rev-parse HEAD` here.)
   cb627bcaccc127a00ab035a2a3006e5cbb6d501d
   
   Build config:
   (Paste the content of config.mk, or the build command.)
   make USE_MKLDNN=1 USE_OPENCV=1 USE_OPENMP=1 USE_GPERFTOOLS=1 
USE_CPP_PACKAGE=1 USE_LAPACK=1 USE_BLAS=mkl -j6
   
   
   
   ## Error Message:
   memory leak (please check attachment "valgring.log" inside the tar file
   
[attach.tar.gz](https://github.com/apache/incubator-mxnet/files/2624877/attach.tar.gz)
   
   )
   
   ## Minimum reproducible example
   I used the program I have paster above.
   
   ## Steps to reproduce
   compile the above program inside "cpp-package/example" folder and run.
   
   ## What have you tried to solve it?
   
   No idea where memory is leaking except it is happening in the step 
"exec->Backward();"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to