提供属性设置oom水线

issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9CHSB

Signed-off-by: rentangyu <rentangyu@huawei.com>
This commit is contained in:
rentangyu 2024-03-28 21:08:04 +08:00
parent ba997e9e94
commit 172a176865
4 changed files with 15 additions and 0 deletions

View File

@ -357,6 +357,11 @@ int SystemProperties::GetArkProperties()
return system::GetIntParameter<int>("persist.ark.properties", -1);
}
std::string SystemProperties::GetMemConfigProperty()
{
return system::GetParameter("persist.ark.mem_config_property", "");
}
std::string SystemProperties::GetArkBundleName()
{
return system::GetParameter("persist.ark.arkbundlename", "");

View File

@ -352,6 +352,8 @@ public:
static int GetArkProperties();
static std::string GetMemConfigProperty();
static std::string GetArkBundleName();
static size_t GetGcThreadNum();

View File

@ -62,6 +62,7 @@ bool ArkJSRuntime::Initialize(const std::string& libraryPath, bool isDebugMode,
#ifdef OHOS_PLATFORM
option.SetArkProperties(SystemProperties::GetArkProperties());
option.SetArkBundleName(SystemProperties::GetArkBundleName());
option.SetMemConfigProperty(SystemProperties::GetMemConfigProperty());
option.SetGcThreadNum(SystemProperties::GetGcThreadNum());
option.SetLongPauseTime(SystemProperties::GetLongPauseTime());
option.SetEnableAsmInterpreter(SystemProperties::GetAsmInterpreterEnabled());

View File

@ -147,4 +147,11 @@ HWTEST_F(PluginAdapterTest, GetDevInfoTest003, TestSize.Level1)
EXPECT_EQ(infoPair.first, INFO_STR_TWO);
EXPECT_EQ(infoPair.second, true);
}
HWTEST_F(PluginAdapterTest, GetMemConfigProperty001, TestSize.Level1)
{
OHOS::system::SetParameter("persist.ark.mem_config_property", "jsHeap500");
std::string ret = SystemProperties::GetMemConfigProperty("persist.ark.mem_config_property", "");
EXPECT_EQ(ret, "jsHeap500");
}
} // namespace OHOS::Ace::Framework