diff --git a/services/backup_sa/src/module_ipc/service_incremental.cpp b/services/backup_sa/src/module_ipc/service_incremental.cpp index ec65795dca61171b170f36ca22c429cc55420357..37cc5996a1fb794bad6eeb19de17484e3f9fe1e4 100644 --- a/services/backup_sa/src/module_ipc/service_incremental.cpp +++ b/services/backup_sa/src/module_ipc/service_incremental.cpp @@ -39,6 +39,7 @@ #include "filemgmt_libhilog.h" #include "ipc_skeleton.h" #include "module_external/bms_adapter.h" +#include "module_external/sms_adapter.h" #include "module_ipc/svc_backup_connection.h" #include "module_ipc/svc_restore_deps_manager.h" #include "parameter.h" @@ -71,6 +72,12 @@ ErrCode Service::Release() HITRACE_METER_NAME(HITRACE_TAG_FILEMANAGEMENT, __PRETTY_FUNCTION__); HILOGI("KILL"); VerifyCaller(session_->GetScenario()); + int32_t oldMemoryParaSize = BConstants::DEFAULT_VFS_CACHE_PRESSURE; + if (session_ != nullptr) { + oldMemoryParaSize = session_->GetMemParaCurSize(); + } + StorageMgrAdapter::UpdateMemPara(oldMemoryParaSize); + HILOGI("Release, set back to oldSize %{public}d", oldMemoryParaSize); SessionDeactive(); return BError(BError::Codes::OK); } @@ -127,6 +134,9 @@ ErrCode Service::InitIncrementalBackupSession(sptr remote) HILOGI("Begin"); try { VerifyCaller(); + int32_t oldSize = StorageMgrAdapter::UpdateMemPara(BConstants::BACKUP_VFS_CACHE_PRESSURE); + HILOGI("InitBackupSession oldSize %{public}d", oldSize); + session_->SetMemParaCurSize(oldSize); session_->Active({.clientToken = IPCSkeleton::GetCallingTokenID(), .scenario = IServiceReverse::Scenario::BACKUP, .clientProxy = remote,