Skip to content

amsikking/shm_win_patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shm_win_patch

Fix a memory leak in SharedMemory on Windows, i.e. the main Class from Pythons 'multiprocessing.shared_memory' module:

Bug details and status:

If 2 or more shared memory objects are created the .unlink() method fails (on windows) so that the memory is not released until all associated process finish (i.e. memory is potentially consumed continuously and not released):

Test:

  • Download and run 'shared_memory_test.py'.
  • If the test is failed then uncomment 'import shm_win-patch' on line 1 and re-run.
  • This should fix the memory leak.

Note:

This is a potentially fragile solution and we may need to update 'shm_win_patch.py' peroidically to keep up with the 'shared_memory.py' repository:

At some point the real fix should be updated in 'shared_memory.py' at which point this patch will no longer be needed...

Acknowledgments:

Thanks to https://github.com/nhthayer for throwing this together

About

Fix a memory leak in SharedMemory on Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages