Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2492933002: Evict from FileByteStore by the total cache size in bytes. (Closed)
Patch Set: Clean up cache in a separate isolate. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 391a76aa70a3c7632529448f16cf0569fad03566..7d709744b443e5203398a9b9e0d9f75a6a1abff9 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -29,6 +29,7 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
import 'package:analyzer/source/pub_package_map_provider.dart';
@@ -367,10 +368,15 @@ class AnalysisServer {
defaultContextOptions.generateImplicitErrors = false;
operationQueue = new ServerOperationQueue();
_analysisPerformanceLogger = new nd.PerformanceLog(io.stdout);
- byteStore = new MemoryCachingByteStore(
- new FileByteStore(
- resourceProvider.getStateLocation('.analysis-driver')),
- 64 * 1024 * 1024);
+ if (resourceProvider is PhysicalResourceProvider) {
+ byteStore = new MemoryCachingByteStore(
+ new FileByteStore(
+ resourceProvider.getStateLocation('.analysis-driver').path,
+ 1024 * 1024 * 1024 /*1 GiB*/),
+ 64 * 1024 * 1024 /*64 MiB*/);
+ } else {
+ byteStore = new MemoryByteStore();
+ }
analysisDriverScheduler =
new nd.AnalysisDriverScheduler(_analysisPerformanceLogger);
analysisDriverScheduler.status.listen(sendStatusNotificationNew);

Powered by Google App Engine
This is Rietveld 408576698