Post

Replies

Boosts

Views

Activity

Comment on WKWebView document.onvisibilitychange event not always being fired. Need to detect page changes reliability from WKUserScript
Thanks a lot for your reply! I seem to be getting better results listening for the window's onpageshow instead of the document.visibilitychange (and checking the visibility state of the document in the event handler to see if its visible) so I think I'm going to remove the document visibilitychange listener and replace it with pageshow.
Topic: Safari & Web SubTopic: General Tags:
Jul ’23
Comment on Memory mapped file: "Cannot allocate memory"
_> I don't appear to have a memory leak here so I'm not sure why my address space limit would keep accumulating as I continue scrolling the table view. _ Looks like the returned UIImages (created with the CGImages) need to be released. They UIImages are stored in a NSCache. Unfortunately NSCache is not automatically removing objects when malloc_error_break is hit. The operating system isn't sending my app a memory warning either. I was under the impression NSCache would remove objects at the appropriate time based on certain OS conditions (like this one) automatically. I guess I should be able to resolve this by setting a count limit on the cache and/or manually emptying the cache when CGImageSourceCreateThumbnailAtIndex returns NULL. After manually emptying the cache of UIImages I'm able to load more without getting another cannot allocate memory error.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’22
Comment on WKWebView document.onvisibilitychange event not always being fired. Need to detect page changes reliability from WKUserScript
Thanks a lot for your reply! I seem to be getting better results listening for the window's onpageshow instead of the document.visibilitychange (and checking the visibility state of the document in the event handler to see if its visible) so I think I'm going to remove the document visibilitychange listener and replace it with pageshow.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23
Comment on Memory mapped file: "Cannot allocate memory"
_> I don't appear to have a memory leak here so I'm not sure why my address space limit would keep accumulating as I continue scrolling the table view. _ Looks like the returned UIImages (created with the CGImages) need to be released. They UIImages are stored in a NSCache. Unfortunately NSCache is not automatically removing objects when malloc_error_break is hit. The operating system isn't sending my app a memory warning either. I was under the impression NSCache would remove objects at the appropriate time based on certain OS conditions (like this one) automatically. I guess I should be able to resolve this by setting a count limit on the cache and/or manually emptying the cache when CGImageSourceCreateThumbnailAtIndex returns NULL. After manually emptying the cache of UIImages I'm able to load more without getting another cannot allocate memory error.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’22