{"_id":"577bc9454ca2f10e006016be","parentDoc":null,"category":{"_id":"56a20bdf8b2e6f0d0018ea84","pages":["56a20e302255370d00ad5ecb"],"project":"56a1f77442dfda0d00046285","__v":1,"version":"56a1f77542dfda0d00046288","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-22T11:00:47.207Z","from_sync":false,"order":3,"slug":"features","title":"Features"},"project":"56a1f77442dfda0d00046285","__v":3,"user":"56a1f82b06150b0d002ad173","version":{"_id":"56a1f77542dfda0d00046288","__v":9,"project":"56a1f77442dfda0d00046285","createdAt":"2016-01-22T09:33:41.397Z","releaseDate":"2016-01-22T09:33:41.397Z","categories":["56a1f77542dfda0d00046289","56a1fdf442dfda0d00046294","56a2079f0067c00d00a2f955","56a20bdf8b2e6f0d0018ea84","56a3e78a94ec0a0d00b39fed","56af19929d32e30d0006d2ce","5721f4e9dcfa860e005bef98","574e870be892bf0e004fde0d","5832fdcdb32d820f0072e12f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-05T14:50:45.117Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"### Memory snapshots\n\nHeapdumps help you investigate how your applications allocate memory. You can compare them to find memory leaks.\n\nAs a best practice, we recommend that 5 minutes after the first heapdump take a second one as well to compare them.\n\nFor comparison, refer to this tutorial: [Finding a Memory Leak in Node.js](https://blog.risingstack.com/finding-a-memory-leak-in-node-js/)\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/rudbMyTg9S8t372DLsAT_memory_compare.png\",\n        \"memory_compare.png\",\n        \"2784\",\n        \"1604\",\n        \"#d35852\",\n        \"\"\n      ],\n      \"caption\": \"memory comparison\"\n    }\n  ]\n}\n[/block]\n### CPU profiles\n\nCPU profiles help you find out which function calls takes how much time.\n\nOnce the Trace agents running on your services receives the request, it profiles the application for 10 seconds.\n\n**To get the most out of this feature, follow these steps:**\n\n1. Request a CPU profile\n2. Download the profile\n3. Open up the Chrome DevTools\n4. Profiles > Load\n5. Choose either the Chart / Bottom up / Top Down view and start investigation your application on the code level\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/YGegJGBAScuOK7VtFreB_cpu_chart.png\",\n        \"cpu_chart.png\",\n        \"2784\",\n        \"1604\",\n        \"#3d516d\",\n        \"\"\n      ],\n      \"caption\": \"CPU profile using the chart view\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/xmP8AqVSsKAGP0qI4lOW_cpu_bottom_up.png\",\n        \"cpu_bottom_up.png\",\n        \"2784\",\n        \"1604\",\n        \"#41546e\",\n        \"\"\n      ],\n      \"caption\": \"CPU profile using the bottom up view\"\n    }\n  ]\n}\n[/block]","excerpt":"Profile your memory and CPU usage","slug":"profiler","type":"basic","title":"Profiler"}

Profiler

Profile your memory and CPU usage

### Memory snapshots Heapdumps help you investigate how your applications allocate memory. You can compare them to find memory leaks. As a best practice, we recommend that 5 minutes after the first heapdump take a second one as well to compare them. For comparison, refer to this tutorial: [Finding a Memory Leak in Node.js](https://blog.risingstack.com/finding-a-memory-leak-in-node-js/) [block:image] { "images": [ { "image": [ "https://files.readme.io/rudbMyTg9S8t372DLsAT_memory_compare.png", "memory_compare.png", "2784", "1604", "#d35852", "" ], "caption": "memory comparison" } ] } [/block] ### CPU profiles CPU profiles help you find out which function calls takes how much time. Once the Trace agents running on your services receives the request, it profiles the application for 10 seconds. **To get the most out of this feature, follow these steps:** 1. Request a CPU profile 2. Download the profile 3. Open up the Chrome DevTools 4. Profiles > Load 5. Choose either the Chart / Bottom up / Top Down view and start investigation your application on the code level [block:image] { "images": [ { "image": [ "https://files.readme.io/YGegJGBAScuOK7VtFreB_cpu_chart.png", "cpu_chart.png", "2784", "1604", "#3d516d", "" ], "caption": "CPU profile using the chart view" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/xmP8AqVSsKAGP0qI4lOW_cpu_bottom_up.png", "cpu_bottom_up.png", "2784", "1604", "#41546e", "" ], "caption": "CPU profile using the bottom up view" } ] } [/block]