HeapHero provides powerful REST API to analyze Java/android heap dumps. This API can be used in CI/CD pipeline to proactively analyze how much memory is wasted due to inefficient programming practices such duplication of strings, over allocation and under utilization of data structures, sub-optimal data type definitions,…. It can be used in production environment too detect memory leaks proactively. This document walks through the steps involved in invoking this REST API through the Postman tool.
(1). Launch Postman tool installed in your system. If you don’t have postman tool installed in your system then download it from the chrome web store. Copy paste the following URL in chrome browser address bar to download postman tool,
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
(2). Select POST method type from the drop-down. By default GET method type is selected in the drop-down menu.
(3). Enter the request URL in the textbox. Find request URL below,
http://api.heaphero.io/analyze-hd-api?apiKey={API_KEY_SENT_IN_EMAIL}
For example, if your API KEY is “abc123xyz” then request URL should be
http://api.heaphero.io/analyze-hd-api?apiKey=abc123xyz
Please find screenshot below for more details,

(4). To upload the heap dump in Postman go to Body section (which is below request URL textbox).
(5). In Body section select Binary
(6). Now click on “Choose Files” button and select your heap dump file.
Please find below screenshot,

(7). Click on Send button. It will send a request to the server and return a JSON response.

Note:
Heap dump analysis API supports additional features such as XML response, compress file support, etc… Learn about these advanced features in this article.