1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 01:15:07 +00:00

Fix some issues uncovered by the spawn stress test.

This commit is contained in:
Andreas Kling 2018-12-26 22:02:24 +01:00
parent f6179ad9f9
commit 3f3535213b
5 changed files with 9 additions and 7 deletions

View file

@ -36,14 +36,13 @@ Keyboard* keyboard;
static void spawn_stress() NORETURN;
static void spawn_stress()
{
dword lastAlloc = sum_alloc;
dword last_sum_alloc = sum_alloc;
for (unsigned i = 0; i < 10000; ++i) {
int error;
Process::create_user_process("/bin/true", (uid_t)100, (gid_t)100, (pid_t)0, error, Vector<String>(), Vector<String>(), tty0);
kprintf("malloc stats: alloc:%u free:%u eternal:%u ", sum_alloc, sum_free, kmalloc_sum_eternal);
kprintf("delta:%u\n", sum_alloc - lastAlloc);
lastAlloc = sum_alloc;
dbgprintf("malloc stats: alloc:%u free:%u eternal:%u !delta:%u\n", sum_alloc, sum_free, kmalloc_sum_eternal, sum_alloc - last_sum_alloc);
last_sum_alloc = sum_alloc;
sleep(60);
}
for (;;) {