Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7264 Discussões

[BUG] Memory leak in cluster pardiso solver when n=1

tlcfem
Principiante
2.499 Visualizações

It seems like when n=1, although makes little sense in practice (but indeed is a valid matrix size), there is a memory leak issue in the cluster pardiso solver.

The attached reproducer is an abridged version of the example file `cl_solver_unsym_c.c`.

Compile and run the executable, the output starts with the following.

*** Error in PARDISO ( insufficient_memory) error_num= 1

*** Error in PARDISO memory allocation: MATCHING_REORDERING_DATA, allocation of 1 bytes failed

total memory wanted here: 142 kbyte



=== PARDISO: solving a real nonsymmetric system ===

Matrix checker is turned ON 

With address sanitizer on, it looks like `mm_internal_malloc` is leaking memory.

==3948==ERROR: LeakSanitizer: detected memory leaks



Direct leak of 128 byte(s) in 1 object(s) allocated from:

#0 0x7f54bcefd9c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69

#1 0x5641c65c4c1c in mm_internal_malloc (/home/runner/work/ezp/ezp/build/pardiso.memleak+0xd8c1c) (BuildId: 147c1dc7a67f9a1d99f4d13e95bd2136fa286a0f)



SUMMARY: AddressSanitizer: 128 byte(s) leaked in 1 allocation(s).

It is reproduced in a standard environment, see the following GitHub workflow.

https://github.com/TLCFEM/ezp/actions/runs/15502135308

 

Seems to be a memory issue?

0 Kudos
4 Respostas
Chao_Y_Intel
Moderador
2.377 Visualizações

Hi,

Intel MKL use internal buffers to facilitate better performance.  These internal buffers may be reported as leaked memory.

Can you check this article, and see if some APIs/environment can help to remove it:
https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-linux/2025-1/avoiding-memory-leaks-in-onemkl.html

thanks,
Chao

tlcfem
Principiante
2.359 Visualizações

Calling mkl_disable_fast_mm does not help, see the following workflow.

https://github.com/TLCFEM/ezp/actions/runs/15530089687

 

Noting the information,

*** Error in PARDISO ( insufficient_memory) error_num= 1

*** Error in PARDISO memory allocation: MATCHING_REORDERING_DATA, allocation of 1 bytes failed

total memory wanted here: 142 kbyte

It seems like some faulty parameters are passed to memory allocation, because when n>1 there is no such an error.

Ruqiu_C_Intel
Moderador
2.167 Visualizações

Hi,


Thank you for submitting the issue.

We have reproduced the issue with the reproducer. We will update this post once there are further improvements.


Regards,

Ruqiu



Fengrui
Moderador
460 Visualizações

This issue has been fixed in the oneMKL 2025.3 release. Please give it a try!

Responder