18635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong/* 28635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * Copyright 2011, The Android Open Source Project 38635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * 48635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * Licensed under the Apache License, Version 2.0 (the "License"); 58635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * you may not use this file except in compliance with the License. 68635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * You may obtain a copy of the License at 78635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * 88635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * http://www.apache.org/licenses/LICENSE-2.0 98635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * 108635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * Unless required by applicable law or agreed to in writing, software 118635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * distributed under the License is distributed on an "AS IS" BASIS, 128635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * See the License for the specific language governing permissions and 148635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong * limitations under the License. 158635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong */ 168635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong#ifndef MEMORY_LEAK_TRACK_UTIL_H 178635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong#define MEMORY_LEAK_TRACK_UTIL_H 188635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong 1907b745e166ee62030960ccea37e117caadf71c32Andy Hung#include <iostream> 2007b745e166ee62030960ccea37e117caadf71c32Andy Hung 218635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dongnamespace android { 228635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong/* 2307b745e166ee62030960ccea37e117caadf71c32Andy Hung * Dump the heap memory of the calling process, sorted by total size 2407b745e166ee62030960ccea37e117caadf71c32Andy Hung * (allocation size * number of allocations). 2507b745e166ee62030960ccea37e117caadf71c32Andy Hung * 2607b745e166ee62030960ccea37e117caadf71c32Andy Hung * limit is the number of unique allocations to return. 278635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong */ 2807b745e166ee62030960ccea37e117caadf71c32Andy Hungextern std::string dumpMemoryAddresses(size_t limit); 298635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong 308635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong}; 318635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong 328635b7b095fbf7ffc63d3ce791891a9116ace1f6James Dong#endif // MEMORY_LEAK_TRACK_UTIL_H 33