Skip to content

Commit 84b1a6c

Browse files
Remove unnecessary app heap memory clean operations to reduce process RSS (#1608)
With hardware boundary checking enabled, the app heap memory comes from `os_mmap()`. Clearing the whole heap in the memory allocator causes process RSS to reach maximum app heap size immediately and wastes lots of memory, so we had better remove the unnecessary memory clean operations in the memory allocator.
1 parent a182926 commit 84b1a6c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

core/shared/mem-alloc/ems/ems_kfc.c

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ gc_init_internal(gc_heap_t *heap, char *base_addr, gc_size_t heap_max_size)
1212
int ret;
1313

1414
memset(heap, 0, sizeof *heap);
15-
memset(base_addr, 0, heap_max_size);
1615

1716
ret = os_mutex_init(&heap->lock);
1817
if (ret != BHT_OK) {
@@ -140,7 +139,6 @@ gc_destroy_with_pool(gc_handle_t handle)
140139
#endif
141140

142141
os_mutex_destroy(&heap->lock);
143-
memset(heap->base_addr, 0, heap->current_size);
144142
memset(heap, 0, sizeof(gc_heap_t));
145143
return ret;
146144
}

0 commit comments

Comments
 (0)