[vm] Ask the OS to release the memory for the clustered portion of the snapshot.
This region is mostly unused after loading, but it may be accessed again if - Isolate.spawn is invoke with isolate groups disabled - A secondary snapshot produced by splitting is loaded - An external typed data in the snapshot is accessed (usually a kernel file) - Likely other cases Even if these cases did not exist, the region is often part of a shared library and so unable to be released independently. madvise(DONT_NEED) on this region will cause the OS to release the memory in this region but keep the address space reservation and mapping. If it is touched again, it will be brought back in from the file. If it is not backed by a file, such as malloc memory, it will be brought back in as zeros and the program will likely fail. TEST=ci Bug: https://github.com/dart-lang/sdk/issues/44019 Bug: https://github.com/flutter/flutter/issues/92120 Change-Id: I315a049b0f7d440e181d0a5e87fa6770a2fd4f79 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216580 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
bca554fcf4
commit
985824de50
@@ -608,6 +608,7 @@ typedef struct {
|
||||
bool copy_parent_code;
|
||||
bool null_safety;
|
||||
bool is_system_isolate;
|
||||
bool snapshot_is_dontneed_safe;
|
||||
} Dart_IsolateFlags;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user