Skip to content

Commit 1a99f15

Browse files
committed
gc
1 parent f9caa7d commit 1a99f15

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/integration-tests-v2.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
node-version: '16'
3434

3535
- name: Install dependencies
36-
run: npm install
36+
run: |
37+
npm install
38+
npm install ts-node
3739
3840
# - name: Setup database and engine
3941
# id: setup
@@ -54,7 +56,7 @@ jobs:
5456
FIREBOLT_CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
5557
FIREBOLT_CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
5658
run: |
57-
npx ts-node scripts/memory-test.ts
59+
node -r 'ts-node/register' --expose-gc scripts/memory-test.ts
5860
5961
6062
# Need to pull the pages branch in order to fetch the previous runs

scripts/memory-test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ async function runMemoryTest(): Promise<void> {
154154
const currentMemory = process.memoryUsage();
155155
maxMemoryUsed = Math.max(maxMemoryUsed, currentMemory.heapUsed);
156156

157-
// Log progress every 25k rows and force GC to help with memory cleanup
157+
// Force garbage collection if available
158+
if (global.gc) {
159+
global.gc();
160+
}
161+
162+
// Log progress every 25k rows
158163
if (rowCount % 25000 === 0) {
159164
const currentGrowth =
160165
(currentMemory.heapUsed - initialMemory.heapUsed) /

0 commit comments

Comments
 (0)