-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Hello,
I've spotted my app which updates its menu regularly reaches multiple GB's of memory over time.
Here is an example code similar to my code's logic, which uses exaggerated values for quick demonstration purposes:
#!/usr/bin/env python3
import rumps
import time
testinterval=0.1
class AwesomeStatusBarApp(rumps.App):
def __init__(self):
super(AwesomeStatusBarApp, self).__init__("myapp")
self.menu = [f"hello"]
@rumps.timer(testinterval)
def sayhi(self, _):
mylist = []
for i in range(1000):
mylist += ['time', str(time.time())*10, None]
# reset menu
self.menu.clear()
self.menu = mylist # or self.menu.update(mylist), doesn't matter
if __name__ == "__main__":
AwesomeStatusBarApp().run()If you look at Activity Monitor, you'll see its memory grows indefinitely. I've also tried iterating over menu keys() and deleting them but didn't fix the leak.
Am I doing something wrong or is it the rumps which leaks memory under the hood?
Metadata
Metadata
Assignees
Labels
No labels