I have a general question about PopClip’s memory usage, particularly with custom extensions.
Sometimes I notice RAM usage increase even when I’m not actively using PopClip. What extension related mechanisms can contribute to this? for example regex/requirements, JavaScript/modules, bundled libraries, dynamic actions, network requests, async operations, or Shell/AppleScript actions, submenus etc.. ?
Are there any general guidelines or best practices based on your experiences for keeping PopClip’s background RAM usage low without hurting functionality?
The reason it’s relatively high is because PopClip uses JavaScriptCore (Apple’s built-in JavaScript execution framework) internally to implement a lot of its operations as well as running extensions. Whilst this brings a lot of benefits, one drawback is that JavaScript environments are known for requiring more RAM than native code.
I can’t really give you a specific answer as to what would make it higher or lower. Although certainly, if a network request downloads a lot of data, that will temporarily spike the RAM a lot.
I had previously noted myself that I’d like to investigate memory usage more deeply to see if there’s anything I can to trim it down. I’ve noticed it is now typically in the 300-400+ MB range for me if I have a lot of extensions installed, whereas in the past it was more the 100s or less,
Much of this is virtual RAM (allocated swap and compressed memory), of course, so it’s not actually using that much physical RAM in your machine. If you enable the Real Memory column in Activity Monitor, the picture doesn’t look so bad.