You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to share a memory leak problem on Windows and a suggestion to solve it.
I am using single-threaded openblas 0.3.7 version with c++ plugin and Windows functions like #1152. A memory leak regarding Private Usage was found for each execution of set of LoadLibrary, BLAS function and FreeLibrary. The size is around 64KB per only one execution. It will be terrible if it piles up.
This occurs because a configuration parameter "MEM_DECOMMIT" of the Windows VirtualFree function is used in memory.c in OpenBLAS. According to MS documentation, VirtualFree has another parameter "MEM_RELEASE" to free memory. I have confirmed that replacing "MEM_DECOMMIT" with "MEM _ RELEASE" solves the memory leak.
I have not found a clear definition yet, but it seems it would indeed leak virtual memory, which could be bad enough to eventually cause serious problems. (One similar case was discussed on the cygwin mailing list years ago, the pertinent part starts at http://www.cygwin.net/ml/cygwin-developers/2003-04/msg00032.html)
Hello, I would like to share a memory leak problem on Windows and a suggestion to solve it.
I am using single-threaded openblas 0.3.7 version with c++ plugin and Windows functions like #1152. A memory leak regarding Private Usage was found for each execution of set of LoadLibrary, BLAS function and FreeLibrary. The size is around 64KB per only one execution. It will be terrible if it piles up.
This occurs because a configuration parameter "MEM_DECOMMIT" of the Windows VirtualFree function is used in memory.c in OpenBLAS. According to MS documentation, VirtualFree has another parameter "MEM_RELEASE" to free memory. I have confirmed that replacing "MEM_DECOMMIT" with "MEM _ RELEASE" solves the memory leak.
The test condition is as follows:
OpenBLAS Version : 0.3.7
Change Points:
//VirtualFree(alloc_info, allocation_block_size, MEM_DECOMMIT);
VirtualFree(alloc_info, 0, MEM_RELEASE);
Build Machine: Ubuntu 19.04 with MinGW-w64, gcc version 8.3.0
Build Option: make BINARY=64 HOSTCC=gcc CC=x86_64-w64-mingw32-gcc CFLAGS='-static-libgcc -static-libstdc++' USE_THREAD=0
Test Machine: Windows 8.1 Pro
Test Program:
I would recommend using "MEM_RELASE" parameter to solve the memory leak problem.
Could you please fix it in the next release?
Thank you!
The text was updated successfully, but these errors were encountered: