realm / realm-core

Core database component for the Realm Mobile Database SDKs
https://realm.io
Apache License 2.0
1.02k stars 163 forks source link

Consider adding debug options to help track mmap issues #1537

Closed jpsim closed 8 years ago

jpsim commented 8 years ago

I had a chat with a large Realm user in Japan yesterday and one of their main woes was hitting mmap failures in production without having much insight into how/when this happens. #1463 will help avoid crashing when this happens once it's integrated into the cocoa binding (tracked as realm/realm-cocoa#2269). #1477 will also really help here.

Until that's done, it'd be useful to have the option to log how much space is mmapped, or the number of distinct mappings used at any given time.

This could be used by end users to determine if they're using more threads than they intend. For example, when using a Grand Central Dispatch queue that's creating new threads rather than reusing them.

finnschiermer commented 8 years ago

At Core level, it is trivial to log the number of open SharedGroups, the number of active versions and the total amount of mmapped memory.

ironage commented 8 years ago

@jpsim each issue originally mentioned has been merged. Is this sufficient to close this now?

jpsim commented 8 years ago

Yes I think the original points I brought up are no longer critical issues.

I still think having better ways to check how many mappings are in use, how many versions are currently active, and ways to be notified of file expansions could be useful debugging tools though.