{"id":18052509,"url":"https://github.com/AnxiousHoliday/MimirMemoryLogger","last_synced_at":"2025-03-27T22:33:21.731Z","repository":{"id":62447801,"uuid":"299414394","full_name":"AnxiousHoliday/MimirMemoryLogger","owner":"AnxiousHoliday","description":"🔥 A fast \u0026 easy way to save snapshots of memory heap to disk on iOS devices and then prettify and sort the snapshot json files accordingly using a simple python script!","archived":false,"fork":false,"pushed_at":"2020-10-11T22:19:31.000Z","size":706,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T16:41:45.802Z","etag":null,"topics":["disk","framework","heap","ios","json-snapshots","logger","logging","logs","memory","memory-heap","memory-snapshots","mimir","objective-c","oom","python-script","snapshot","stack","swift"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnxiousHoliday.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-28T19:42:39.000Z","updated_at":"2023-03-20T12:29:10.000Z","dependencies_parsed_at":"2022-11-01T23:17:31.694Z","dependency_job_id":null,"html_url":"https://github.com/AnxiousHoliday/MimirMemoryLogger","commit_stats":null,"previous_names":["amereid/mimirmemorylogger","thehol1day/mimirmemorylogger"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnxiousHoliday%2FMimirMemoryLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnxiousHoliday%2FMimirMemoryLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnxiousHoliday%2FMimirMemoryLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnxiousHoliday%2FMimirMemoryLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnxiousHoliday","download_url":"https://codeload.github.com/AnxiousHoliday/MimirMemoryLogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245936888,"owners_count":20696912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disk","framework","heap","ios","json-snapshots","logger","logging","logs","memory","memory-heap","memory-snapshots","mimir","objective-c","oom","python-script","snapshot","stack","swift"],"created_at":"2024-10-30T23:12:06.149Z","updated_at":"2025-03-27T22:33:21.708Z","avatar_url":"https://github.com/AnxiousHoliday.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./Resources/mimir-memory-logger-logo.png\" width=400 /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://cocoapods.org/pods/MimirMemoryLogger\"\u003e\n      \u003cimg src=\"https://img.shields.io/travis/amereid/MimirMemoryLogger.svg?style=flat)](https://travis-ci.org/amereid/Mimir\"\n           alt=\"CI Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cocoapods.org/pods/MimirMemoryLogger\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/v/MimirMemoryLogger.svg?style=flat)](https://cocoapods.org/pods/MimirMemoryLogger\"\n           alt=\"Pods Version\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cocoapods.org/pods/MimirMemoryLogger\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/l/MimirMemoryLogger.svg?style=flat\"\n             alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cocoapods.org/pods/MimirMemoryLogger\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/p/MimirMemoryLogger.svg?style=flat\"\n             alt=\"Platform\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Heap logging framework for iOS (Memory snapshots)\n\n## Overview\nMimirMemoryLogger is a memory logging framework (Swift \u0026 Objective-C) that is intended to help developers better debug memory issues when connecting the device to Xcode is not possible.\n\nWhat this framework does is basically takes a snapshot of the iOS device's heap and saves it to disk as a json file. This json file can then be used alongside a python script i wrote (please don't judge my python code 😅) that loops over all the memory instances in the json file and sorts them accordingly in terminal.\n\n## How it works\n\n1. Trigger saving memory heap snapshot whenever you want (e.g when the app receives `applicationDidReceiveMemoryWarning`)\n2. MimirMemoryLogger saves the memory snapshot to disk\n3. User sends memory snapshot (automatically or manually) to developer\n4. Developer runs python script with the json memory snapshot as a parameter\n5. Script shows the memory heap usage of your app which allows the developer to look into the reason of heavy memory usage\n\n### Python Script Samples\nThese are 2 samples of what the result of using the heap snapshot json file with the python script (included in the repo)\n\n![python script mimir MimirMemoryLogger](./Resources/python-script-sample1.png)\n\n![python script mimir MimirMemoryLogger](./Resources/python-script-sample2.png)\n\nSamples of json memory snapshots are in ./Resources/snapshot-samples\n\n# Usage - Swift\n\n## Taking snapshot of memory\n\n```swift\nimport MimirMemoryLogger // Do not forget this\n\nMimirMemoryLogger.saveCurrentSnapshotToFile { (url) -\u003e (Void) in\n  if let url = url {\n    print(\"Memory snapshot location: \\(url.absoluteString)\")\n  }\n}\n```\n\n## Getting previously saved snapshots\n\n```swift\nif let urls = MimirMemoryLogger.getSavedSnapshots() {\n  print(\"URLS of all saved snapshots: \\(urls)\")\n}\n```\n\n## Customization\nYou can set the maximum number of snapshots that persist on disk. Default is 5\n\n```swift\nMimirMemoryLogger.maxNumberOfSnapshots = 3\n```\n\nIf you want more details on what is happening while saving and getting snapshots, you can set verbose to true in MimirMemoryLogger. This will print to console added details and information such as time it takes to save a snapshot or if there are any errors.\n\n```swift\nMimirMemoryLogger.verbose = true\n```\n\n# Usage - Python Script\n\n## Viewing the json snapshots in terminal\nThis project relies on one Python script that sorts and prettifies the results in a json snapshot file just like in the sample images at the beginning of this readme. This script is located here: `./PythonScripts/MimirMemoryLogger.py`\n\nThis script was written with the help of [BeautifulTable](https://github.com/pri22296/beautifultable).\n\nJust call this script with the json file as an argument (samples of json snapshots are in ./Resources/snapshot-samples).\n\nFor example:\n\n```bash\npython3 MimirMemoryLogger sample-snapshot.json\n```\n\n## Notes\n\nThis framework is still in the early phases and will keep evolving.\n\nIf you use this framework and happen to like it, feel free to let me know 😊\n\n## Installation\n\nMimir is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```swift\npod 'MimirMemoryLogger'\n```\n\n## Author\n\nAmer Eid, amereid92@gmail.com\n\n## License\n\nMimir is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnxiousHoliday%2FMimirMemoryLogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnxiousHoliday%2FMimirMemoryLogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnxiousHoliday%2FMimirMemoryLogger/lists"}