mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-26 19:50:55 +00:00
!9511 Fix cocurrent mark trigger problem in cold start
Merge pull request !9511 from xiongluo/mark_trigger_fix_cold
This commit is contained in:
commit
fd401c22e5
@ -2248,7 +2248,7 @@ bool Heap::HandleExitHighSensitiveEvent()
|
||||
{
|
||||
AppSensitiveStatus status = GetSensitiveStatus();
|
||||
if (status == AppSensitiveStatus::EXIT_HIGH_SENSITIVE
|
||||
&& CASSensitiveStatus(status, AppSensitiveStatus::NORMAL_SCENE)) {
|
||||
&& CASSensitiveStatus(status, AppSensitiveStatus::NORMAL_SCENE) && !OnStartupEvent()) {
|
||||
// Set record heap obj size 0 after exit high senstive
|
||||
SetRecordHeapObjectSizeBeforeSensitive(0);
|
||||
// set overshoot size to increase gc threashold larger 8MB than current heap size.
|
||||
|
@ -158,6 +158,28 @@ HWTEST_F_L0(GCTest, HighSensitiveExceedMaxHeapSize)
|
||||
EXPECT_TRUE(commitSize < thread->GetEcmaVM()->GetEcmaParamConfiguration().GetMaxHeapSize());
|
||||
}
|
||||
|
||||
HWTEST_F_L0(GCTest, ColdStartNoConcurrentMark)
|
||||
{
|
||||
auto heap = const_cast<Heap *>(thread->GetEcmaVM()->GetHeap());
|
||||
heap->NotifyPostFork();
|
||||
heap->NotifyHighSensitive(true);
|
||||
{
|
||||
[[maybe_unused]] ecmascript::EcmaHandleScope baseScope(thread);
|
||||
for (int i = 0; i < 500; i++) {
|
||||
[[maybe_unused]] JSHandle<TaggedArray> array = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(
|
||||
10 * 1024, JSTaggedValue::Hole(), MemSpaceType::SEMI_SPACE);
|
||||
}
|
||||
}
|
||||
EXPECT_FALSE(heap->HandleExitHighSensitiveEvent());
|
||||
heap->NotifyHighSensitive(false);
|
||||
EXPECT_FALSE(heap->HandleExitHighSensitiveEvent());
|
||||
heap->FinishStartupEvent();
|
||||
|
||||
heap->NotifyHighSensitive(true);
|
||||
heap->NotifyHighSensitive(false);
|
||||
EXPECT_TRUE(heap->HandleExitHighSensitiveEvent());
|
||||
}
|
||||
|
||||
HWTEST_F_L0(GCTest, CallbackTask)
|
||||
{
|
||||
auto vm = thread->GetEcmaVM();
|
||||
|
Loading…
Reference in New Issue
Block a user