Use python ctypes library of dynamic memory application and release

 

1, before the application memory usage

2, the application memory

from ctypes Import *
 Import Time 

# apply here 1G memory unit K 

MEM = The create_string_buffer (1024 * 1024 * 1024 ) 

the time.sleep ( 10 ) 

# release memory 
mem = None

 

3. After the application memory usage

4, after the release of memory memory consumption

 

Guess you like

Origin www.cnblogs.com/phyger/p/11372747.html