mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[core] disable new FilePageCache
+ `FilePageCacheLockFree` was developed to replace regular `FilePageCache` but that project was postponed for a long time in favor of using memory-mapped files for performance-critical storages. Current storages don't use `FilePageCacheLockFree`, hence it pays off disabling it and yield ~120Mb of native memory to regular `FilePageCache` GitOrigin-RevId: ad6ceb85f891e6e737972f208c276582789cdb4f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d3f887d635
commit
2f43f915a6
+10
-1
@@ -1,11 +1,13 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.util.io.storage;
|
||||
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.dev.content.ContentHashEnumeratorOverDurableEnumerator;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.dev.content.ContentStorageAdapter;
|
||||
import com.intellij.util.io.PageCacheUtils;
|
||||
import com.intellij.util.io.storage.lf.RefCountingContentStorageImplLF;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
@@ -13,11 +15,18 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static com.intellij.util.io.storage.CapacityAllocationPolicy.FIVE_PERCENT_FOR_GROWTH;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
public class VFSContentStorageAdapterTest extends VFSContentStorageTestBase<ContentStorageAdapter> {
|
||||
|
||||
private ExecutorService storingPool;
|
||||
|
||||
@BeforeAll
|
||||
static void checkLockFreeEnabled() {
|
||||
assumeTrue(PageCacheUtils.LOCK_FREE_PAGE_CACHE_ENABLED,
|
||||
"ContentHashEnumeratorOverDurableEnumerator expects lock-free FilePageCache to be enabled");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull ContentStorageAdapter openStorage(@NotNull Path storagePath) throws IOException {
|
||||
storingPool = Executors.newSingleThreadExecutor(r -> new Thread(r, "ContentWriting Pool"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.util.io;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -46,7 +46,7 @@ public final class PageCacheUtils {
|
||||
* So far both new and {@link FilePageCache legacy} file caches co-exist: storages are incrementally migrated
|
||||
* to new cache
|
||||
*/
|
||||
public static final boolean LOCK_FREE_PAGE_CACHE_ENABLED = getBooleanProperty("vfs.lock-free-impl.enable", true);
|
||||
public static final boolean LOCK_FREE_PAGE_CACHE_ENABLED = getBooleanProperty("vfs.lock-free-impl.enable", false);
|
||||
|
||||
/**
|
||||
* How much direct memory the new (code name 'lock-free') FilePageCache impl allowed to utilize: as a fraction
|
||||
|
||||
Reference in New Issue
Block a user