question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to properly shutdown?

See original GitHub issue

How should I properly close the shared memory? My processes end with:

/usr/lib/python3/dist-packages/multiprocessing_resource_tracker.py:226: UserWarning: resource_tracker: There appear to be 3 leaked shared_memory objects to clean up at shutdown
  (len(rtype_cache), rtype))

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
spaceonecommented, Oct 6, 2021

cleanup() seems not enough:

python3 -c 'from shared_memory_dict import *; SharedMemoryDict("x", 6).cleanup()'
/usr/lib/python3/dist-packages/multiprocessing_resource_tracker.py:226: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
  (len(rtype_cache), rtype)

works with unlink (https://docs.python.org/3/library/multiprocessing.shared_memory.html#multiprocessing.shared_memory.SharedMemory.unlink): python3 -c 'from shared_memory_dict import *; x = SharedMemoryDict("x", 6); x.cleanup(); x._memory_block.unlink()'

0reactions
cassiobotarocommented, Oct 26, 2021

In version 0.7.0 I expose shared memory and also add examples with calls to close and unlink. I’ll close this issue, but feel free to reopen if necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

P.C. Periodicals: The correct way to shut down your computer
Proper method for shutdown · Step 1: Click the 'Windows' button at the bottom left-hand corner of your screen. · Step 2: Click...
Read more >
How to Shut Down a Computer
Shut down in Windows 10 ... Press Ctrl + Alt + Del and click the power button in the bottom-right corner of the...
Read more >
How to shut down your computer properly - Total Defense
Steps for shutting down your computer properly · 1. Save your progress · 2. Log off from social media · 3. Close all...
Read more >
Your Windows PC may not be fully shutting down - Tom's Guide
How to fully shut down a Windows PC · 1. Enter the control panel. · 2. Click Hardware and Sound. · 3. Under...
Read more >
How To Properly Shut Down A Windows 10 PC
The easiest method is to simply hold down the shift key before you click the power icon and select “shut down” on Windows'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found