Open
Description
I found a memory leak when loading and releasing dynamic function snapshot. My code looks like that:
jerry_value_t return_value;
return_value = jerry_load_function_snapshot(snapshot, snapshot_size, 0, JERRY_SNAPSHOT_EXEC_ALLOW_STATIC);
// The current allocated heap increase 3984 bytes
jerry_release_value(return_value);
jerry_gc(JERRY_GC_SEVERITY_HIGH);
// The current allocated heap decrease 2224 bytes
return_value = jerry_load_function_snapshot(snapshot, snapshot_size, 0, JERRY_SNAPSHOT_EXEC_ALLOW_STATIC);
// The current allocated heap increase 2112 bytes
jerry_release_value(return_value);
jerry_gc(JERRY_GC_SEVERITY_HIGH);
// The current allocated heap decrease 2224 bytes
The issue was not happened if I use static snapshot instead of dynamic snapshot (the heap always increases and decreases by exactly 24 bytes). I just want to know where does this leak come from, and is there anyway to remove a loaded dynamic snapshot completely?