Skip to content

Commit

Permalink
chore: reduce MEMORY_LEAK_SNAPSHOT_THRESHOLD to 500 KB
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
  • Loading branch information
victor-yanev committed Jul 19, 2024
1 parent d627d17 commit f0f9acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { HeapDifferenceStatistics } from '../types/HeapDifferenceStatistics';

export class Utils {
static readonly TOTAL_HEAP_SIZE_MEMORY_LEAK_THRESHOLD: number = 100e6; // 100 MB
static readonly MEMORY_LEAK_SNAPSHOT_THRESHOLD: number = 1e6; // 1 MB
static readonly MEMORY_LEAK_SNAPSHOT_THRESHOLD: number = 5e5; // 500 KB

/**
* Converts a number to its hexadecimal representation.
Expand Down Expand Up @@ -439,7 +439,7 @@ export class Utils {
},
}));
console.error(
`Memory leak of ${Utils.formatBytes(totalDiffBytes)}: --> ` + JSON.stringify(statsDiff, null, 2),
`Total Heap Size ${Utils.formatBytes(totalDiffBytes)}: --> ` + JSON.stringify(statsDiff, null, 2),
);
// add comment on PR highlighting after which test the memory leak is happening
const testTitle = this.currentTest?.title ?? 'Unknown test';
Expand Down

0 comments on commit f0f9acb

Please sign in to comment.