Skip to content

Commit

Permalink
Merge pull request #1429 from ashitsalesforce/master
Browse files Browse the repository at this point in the history
make the process tests fail if used memory at end of the test goes up…
  • Loading branch information
ashitsalesforce authored Dec 31, 2024
2 parents 811dfaa + ae85744 commit 8690303
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Binary file removed java_pid11058.hprof
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ public void setUpMemoryProfiling() throws Exception {
public void tearDownMemoryProfiling() throws Exception {
System.gc();
long usedMemoryAfter = runtime.totalMemory() - runtime.freeMemory();
long memoryIncreaseAfterUse = usedMemoryAfter - usedMemoryBefore;
if (memoryIncreaseAfterUse > 2000000) {
System.out.println("\n==========================");
System.out.println("memory increase after use: " + memoryIncreaseAfterUse / 1024/1024 + "Mb");
System.out.println("==========================\n");
long memoryIncreaseAfterUseInMb = (usedMemoryAfter - usedMemoryBefore)/1024/1024;
if (memoryIncreaseAfterUseInMb > 2) {
logger.warn("memory increase after use: " + memoryIncreaseAfterUseInMb + "Mb");
}
assertTrue("potential memory leak", memoryIncreaseAfterUseInMb < 20);
AppUtil.enableUsedHeapCapture(false);
}

Expand Down

0 comments on commit 8690303

Please sign in to comment.