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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core'; 9 import 'dart:core';
10 import 'dart:io' as io; 10 import 'dart:io' as io;
(...skipping 11 matching lines...) Expand all
22 import 'package:analysis_server/src/plugin/server_plugin.dart'; 22 import 'package:analysis_server/src/plugin/server_plugin.dart';
23 import 'package:analysis_server/src/services/correction/namespace.dart'; 23 import 'package:analysis_server/src/services/correction/namespace.dart';
24 import 'package:analysis_server/src/services/index/index.dart'; 24 import 'package:analysis_server/src/services/index/index.dart';
25 import 'package:analysis_server/src/services/search/search_engine.dart'; 25 import 'package:analysis_server/src/services/search/search_engine.dart';
26 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 26 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
27 import 'package:analysis_server/src/single_context_manager.dart'; 27 import 'package:analysis_server/src/single_context_manager.dart';
28 import 'package:analyzer/dart/ast/ast.dart'; 28 import 'package:analyzer/dart/ast/ast.dart';
29 import 'package:analyzer/dart/element/element.dart'; 29 import 'package:analyzer/dart/element/element.dart';
30 import 'package:analyzer/exception/exception.dart'; 30 import 'package:analyzer/exception/exception.dart';
31 import 'package:analyzer/file_system/file_system.dart'; 31 import 'package:analyzer/file_system/file_system.dart';
32 import 'package:analyzer/file_system/physical_file_system.dart';
32 import 'package:analyzer/instrumentation/instrumentation.dart'; 33 import 'package:analyzer/instrumentation/instrumentation.dart';
33 import 'package:analyzer/plugin/resolver_provider.dart'; 34 import 'package:analyzer/plugin/resolver_provider.dart';
34 import 'package:analyzer/source/pub_package_map_provider.dart'; 35 import 'package:analyzer/source/pub_package_map_provider.dart';
35 import 'package:analyzer/src/context/builder.dart'; 36 import 'package:analyzer/src/context/builder.dart';
36 import 'package:analyzer/src/dart/analysis/byte_store.dart'; 37 import 'package:analyzer/src/dart/analysis/byte_store.dart';
37 import 'package:analyzer/src/dart/analysis/driver.dart' as nd; 38 import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
38 import 'package:analyzer/src/dart/analysis/file_byte_store.dart'; 39 import 'package:analyzer/src/dart/analysis/file_byte_store.dart';
39 import 'package:analyzer/src/dart/analysis/file_state.dart' as nd; 40 import 'package:analyzer/src/dart/analysis/file_state.dart' as nd;
40 import 'package:analyzer/src/dart/analysis/status.dart' as nd; 41 import 'package:analyzer/src/dart/analysis/status.dart' as nd;
41 import 'package:analyzer/src/dart/ast/utilities.dart'; 42 import 'package:analyzer/src/dart/ast/utilities.dart';
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 defaultContextOptions.incremental = true; 361 defaultContextOptions.incremental = true;
361 defaultContextOptions.incrementalApi = 362 defaultContextOptions.incrementalApi =
362 options.enableIncrementalResolutionApi; 363 options.enableIncrementalResolutionApi;
363 defaultContextOptions.incrementalValidation = 364 defaultContextOptions.incrementalValidation =
364 options.enableIncrementalResolutionValidation; 365 options.enableIncrementalResolutionValidation;
365 defaultContextOptions.finerGrainedInvalidation = 366 defaultContextOptions.finerGrainedInvalidation =
366 options.finerGrainedInvalidation; 367 options.finerGrainedInvalidation;
367 defaultContextOptions.generateImplicitErrors = false; 368 defaultContextOptions.generateImplicitErrors = false;
368 operationQueue = new ServerOperationQueue(); 369 operationQueue = new ServerOperationQueue();
369 _analysisPerformanceLogger = new nd.PerformanceLog(io.stdout); 370 _analysisPerformanceLogger = new nd.PerformanceLog(io.stdout);
370 byteStore = new MemoryCachingByteStore( 371 if (resourceProvider is PhysicalResourceProvider) {
371 new FileByteStore( 372 byteStore = new MemoryCachingByteStore(
372 resourceProvider.getStateLocation('.analysis-driver')), 373 new FileByteStore(
373 64 * 1024 * 1024); 374 resourceProvider.getStateLocation('.analysis-driver').path,
375 1024 * 1024 * 1024 /*1 GiB*/),
376 64 * 1024 * 1024 /*64 MiB*/);
377 } else {
378 byteStore = new MemoryByteStore();
379 }
374 analysisDriverScheduler = 380 analysisDriverScheduler =
375 new nd.AnalysisDriverScheduler(_analysisPerformanceLogger); 381 new nd.AnalysisDriverScheduler(_analysisPerformanceLogger);
376 analysisDriverScheduler.status.listen(sendStatusNotificationNew); 382 analysisDriverScheduler.status.listen(sendStatusNotificationNew);
377 analysisDriverScheduler.start(); 383 analysisDriverScheduler.start();
378 if (useSingleContextManager) { 384 if (useSingleContextManager) {
379 contextManager = new SingleContextManager(resourceProvider, sdkManager, 385 contextManager = new SingleContextManager(resourceProvider, sdkManager,
380 packageResolverProvider, analyzedFilesGlobs, defaultContextOptions); 386 packageResolverProvider, analyzedFilesGlobs, defaultContextOptions);
381 } else { 387 } else {
382 contextManager = new ContextManagerImpl( 388 contextManager = new ContextManagerImpl(
383 resourceProvider, 389 resourceProvider,
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 /** 2056 /**
2051 * The [PerformanceTag] for time spent in server request handlers. 2057 * The [PerformanceTag] for time spent in server request handlers.
2052 */ 2058 */
2053 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 2059 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
2054 2060
2055 /** 2061 /**
2056 * The [PerformanceTag] for time spent in split store microtasks. 2062 * The [PerformanceTag] for time spent in split store microtasks.
2057 */ 2063 */
2058 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 2064 static PerformanceTag splitStore = new PerformanceTag('splitStore');
2059 } 2065 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698