You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The leak has no correspondence to the size of the data returned by Caffeinator (e.g., causing options to always return a 100-element array leaks no more memory than having options always be empty). Even after replacing ScriptingCaffeination with a dummy class that does no meaningful computation, the leak remains.
After 30 minutes of periodic AppleScript events (triggered by two-second polling by BetterTouchTool), leaked memory totaled approximately 2.4 MB. Over extended use, hundreds of megabytes have been observed to leak. Instruments does not seem to detect these cumulative leaks, but rather detects only a single, initial, 16-byte leak of category Security::CodeSigning::SecStaticCode::ValidationContext. Allocations seem to stem from AEProcessAppleEvent in the call tree.
Proposed Resolution
Continue investigating behavior and source of memory leak. This may have to do with the design of OSA and how scripting is implemented.
The text was updated successfully, but these errors were encountered:
Issue
Using the Caffeinator suite in JXA causes a memory leak when accessing properties on the
caffeination
object (e.g.,options
,active
).Steps to Reproduce
The following script will cause about .3–.5 MB to be leaked (whereas the commented bottom-most line—using the Application suite—causes no leak):
The leak has no correspondence to the size of the data returned by Caffeinator (e.g., causing
options
to always return a 100-element array leaks no more memory than havingoptions
always be empty). Even after replacingScriptingCaffeination
with a dummy class that does no meaningful computation, the leak remains.After 30 minutes of periodic AppleScript events (triggered by two-second polling by BetterTouchTool), leaked memory totaled approximately 2.4 MB. Over extended use, hundreds of megabytes have been observed to leak. Instruments does not seem to detect these cumulative leaks, but rather detects only a single, initial, 16-byte leak of category
Security::CodeSigning::SecStaticCode::ValidationContext
. Allocations seem to stem fromAEProcessAppleEvent
in the call tree.Proposed Resolution
Continue investigating behavior and source of memory leak. This may have to do with the design of OSA and how scripting is implemented.
The text was updated successfully, but these errors were encountered: