mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-11 09:25:20 +00:00
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.
This commit is contained in:
parent
a182926a73
commit
84b1a6c10e
|
@ -12,7 +12,6 @@ gc_init_internal(gc_heap_t *heap, char *base_addr, gc_size_t heap_max_size)
|
|||
int ret;
|
||||
|
||||
memset(heap, 0, sizeof *heap);
|
||||
memset(base_addr, 0, heap_max_size);
|
||||
|
||||
ret = os_mutex_init(&heap->lock);
|
||||
if (ret != BHT_OK) {
|
||||
|
@ -140,7 +139,6 @@ gc_destroy_with_pool(gc_handle_t handle)
|
|||
#endif
|
||||
|
||||
os_mutex_destroy(&heap->lock);
|
||||
memset(heap->base_addr, 0, heap->current_size);
|
||||
memset(heap, 0, sizeof(gc_heap_t));
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user