Skip to content

🎥 Make videos programmatically with React

Update rust-memory-usage.test.ts

Jonny Burger60ff098c4da0
diff --git a/packages/renderer/src/test/rust-memory-usage.test.ts b/packages/renderer/src/test/rust-memory-usage.test.ts
index 5dc13ef835..e76d0a7ad1 100644
--- a/packages/renderer/src/test/rust-memory-usage.test.ts
+++ b/packages/renderer/src/test/rust-memory-usage.test.ts
@@ -148,7 +148,10 @@ test('Should be able to take commands for freeing up memory', async () => {
});
function getMemoryUsageByPid(pid: string) {
- const data = execSync(`top -l 1 -pid ${pid} -stats mem`);
+ const data =
+ process.platform === 'darwin'
+ ? execSync(`top -l 1 -pid ${pid} -stats mem`)
+ : execSync(`ps -p ${pid} -o rss= | awk '{print $1 * 1024}'`);
const str = data.toString('utf-8');
const lines = str.split('\n');
const last = lines[lines.length - 2];