// try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());I am unsure whether this actually works it was AI generated, should we just remove the whole comment?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());I am unsure whether this actually works it was AI generated, should we just remove the whole comment?
Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());Stephen NuskoI am unsure whether this actually works it was AI generated, should we just remove the whole comment?
Rather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?
Sounds good. Removed the code and updated the comment to reference the docs.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());Stephen NuskoI am unsure whether this actually works it was AI generated, should we just remove the whole comment?
Kartar SinghRather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?
Sounds good. Removed the code and updated the comment to reference the docs.
Okay it's obsolete now 😄.
Some [new usage](https://crrev.com/c/8014041) of JavaHeapDumpGenerator was added meanwhile, so ended up keeping the class and the comment.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// try {
// android.os.Debug.dumpHprofData(filePath);
// Log.e("MemoryDump", "Heap dump captured at: " + filePath);
// } catch (java.io.IOException e) {
// Log.e("MemoryDump", "Error writing to file " + filePath + ". Error: " +
// e.getMessage());Stephen NuskoI am unsure whether this actually works it was AI generated, should we just remove the whole comment?
Kartar SinghRather than writing the code in a comment that hasn't been tested perhaps just link to https://developer.android.com/reference/android/os/Debug#dumpHprofData(java.lang.String) and suggest you use that for debugging? and let folks figure it out when/if they need it?
Kartar SinghSounds good. Removed the code and updated the comment to reference the docs.
Okay it's obsolete now 😄.
Some [new usage](https://crrev.com/c/8014041) of JavaHeapDumpGenerator was added meanwhile, so ended up keeping the class and the comment.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Remove unused JavaHeapProfiler and JavaHeapDumpGenerator
This CL removes the unused `JavaHeapProfiler` class and its helper
classes in `services/tracing/public/cpp/perfetto/java_heap_profiler`.
`JavaHeapProfiler::GetInstance()` was not called anywhere, making this
dead code.
Additionally, this CL removes `JavaHeapDumpGenerator` from `base`,
as it was only used by `JavaHeapProfiler` and in a commented-out
debugging block in `GarbageCollectionTestUtils.java`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |