Home > other >  Python how to release the dynamic link library, release of dynamic library resources?
Python how to release the dynamic link library, release of dynamic library resources?

Time:11-25

Excuse me, how to release in python dynamic library and its memory?

Program logic basic for:
1. In the main thread: use ctypes. CDLL. LoadLibrary (' xx. So) load dynamic library
2. In the main thread: 2 sets of traverse mongo (double loop), inner loop has load dynamic library functions in the computation and put back the results

Problems:
1. Because the mongo collection is large, lead to many times on the main thread using dynamic function in the library, the program memory occupancy rate has risen sharply, main process killed by system operation to a certain degree,
2. Most have identified the program memory is occupied by a dynamic library,

Now want to inner loop released after the completion of a dynamic library and its memory,

Dear bosses, this how to solve? Kindly, advise
  • Related