{"id":13429328,"url":"https://github.com/bytedance/tailor","last_synced_at":"2025-04-13T02:19:39.318Z","repository":{"id":44328716,"uuid":"317544943","full_name":"bytedance/tailor","owner":"bytedance","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-16T11:39:09.000Z","size":2557,"stargazers_count":740,"open_issues_count":1,"forks_count":94,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-04T04:11:58.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bytedance.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-01T13:10:16.000Z","updated_at":"2025-04-02T06:15:31.000Z","dependencies_parsed_at":"2024-01-18T14:41:05.329Z","dependency_job_id":"0d05e4a8-15d7-4fa3-82fe-a8f699308b78","html_url":"https://github.com/bytedance/tailor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytedance%2Ftailor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytedance%2Ftailor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytedance%2Ftailor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytedance%2Ftailor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytedance","download_url":"https://codeload.github.com/bytedance/tailor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654374,"owners_count":21140287,"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":[],"created_at":"2024-07-31T02:00:35.143Z","updated_at":"2025-04-13T02:19:39.294Z","avatar_url":"https://github.com/bytedance.png","language":"C","funding_links":[],"categories":["APM 开源项目","Android性能优化"],"sub_categories":["APM相关开源组件/系统"],"readme":"# Tailor\n\n[简体中文版说明 \u003e\u003e\u003e](/README_cn.md)\n\n[![GitHub license](https://img.shields.io/badge/license-Apache--2.0-brightgreen.svg)](https://github.com/bytedance/tailor/blob/master/LICENSE)\n[![Platform](https://img.shields.io/badge/Platform-Android-brightgreen.svg)](https://developer.android.com)\n[![API](https://img.shields.io/badge/api-14%2B-green)](https://developer.android.com/about/dashboards)\n\nTailor is a general-purpose hprof cropping and compression tool developed by Xigua video android\nteam. Through it, a mini hprof file can be dump directly during exception handling. There is no\nsensitive information in the file。More importantly, the file is small but the data is relatively\ncomplete, which is very suitable for offline analysis of oom and other exceptions\n\n## Apps using Tailor\n\u003cimg src=\"docs/xigua.png\" width=\"100\"/\u003e\u003cimg src=\"docs/douyin.png\" width=\"100\"/\u003e\u003cimg src=\"docs/huoshan.png\" width=\"100\"/\u003e\u003cimg src=\"docs/kaiyan.png\" width=\"100\"/\u003e\n\n## Get started\nStep 1: Add the JitPack repository to your build file\n```gradle\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nStep 2: Add the dependency\n```gradle\ndependencies {\n    implementation 'com.github.bytedance:tailor:1.1.6'\n}\n```\n\nStep 3: Add code for simple usage\n```Java\nif (e instanceof java.lang.OutOfMemoryError) {\n    String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + \"mini.hprof\";\n    try {\n        Tailor.dumpHprofData(path, true);\n    } catch (IOException ex) {\n        ex.printStackTrace();\n    }\n}\n```\n\n```Java\n// Crop and compress the existing hprof files directly\nTailor.cropHprofData(source, target, true);\n```\n\nStep 4: Upload data\n```shell\n## !!! App needs to implement upload logic by itself\n```\n\nStep 5: Process data (Python version \u003e= 3.5)\n```shell\n## Data recovery\npython3 library/src/main/python/decode.py -i mini.hprof -o target.hprof\n```\n\n```shell\n## Hprof verify\npython3 library/src/main/python/verify.py -i source.hprof\n```\n\n```shell\n## Crop and compress\npython3 library/src/main/python/encode.py -i source.hprof -o mini.hprof\n```\n\n## Extra\n1. [Android Camera内存问题剖析](https://mp.weixin.qq.com/s/-oaN-bOqHDjN30UP1FMpgA)\n2. [西瓜视频稳定性治理体系建设一：Tailor 原理及实践](https://mp.weixin.qq.com/s/DWOQ9MSTkKSCBFQjPswPIQ)\n3. [西瓜视频稳定性治理体系建设二：Raphael 原理及实践](https://mp.weixin.qq.com/s/RF3m9_v5bYTYbwY-d1RloQ)\n\n## Support\n1. Communicate on [GitHub issues](https://github.com/bytedance/tailor/issues)\n2. Mail: \u003ca href=\"mailto:shentianzhou.stz@gmail.com\"\u003eshentianzhou.stz@gmail.com\u003c/a\u003e\n3. WeChat: 429013449\n4. QQ Group\n\u003cp align=\"left\"\u003e\u003cimg src=\"docs/qqgroup.jpg\" alt=\"QQ Group\" width=\"320px\"\u003e\u003c/p\u003e\n\n## License\n~~~\nCopyright (c) 2020 ByteDance Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n~~~","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytedance%2Ftailor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytedance%2Ftailor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytedance%2Ftailor/lists"}