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

Issue 2492933002: Evict from FileByteStore by the total cache size in bytes. (Closed)

Created:
4 years, 1 month ago by scheglov
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Evict from FileByteStore by the total cache size in bytes. Limit the size in Analysis Server to 1 GiB. Ideally we would need to in constructor all files by access time. But requesting stats is much more expensive than just length :-( R=brianwilkerson@google.com, paulberry@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/89eabc80836b25ce79c1c085d8280225d667cb89

Patch Set 1 #

Total comments: 2

Patch Set 2 : Clean up cache in a separate isolate. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -14 lines) Patch
M pkg/analysis_server/lib/src/analysis_server.dart View 1 2 chunks +10 lines, -4 lines 0 comments Download
M pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart View 1 2 chunks +117 lines, -10 lines 7 comments Download

Messages

Total messages: 15 (2 generated)
scheglov
4 years, 1 month ago (2016-11-10 22:00:37 UTC) #1
Brian Wilkerson
lgtm https://codereview.chromium.org/2492933002/diff/1/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right): https://codereview.chromium.org/2492933002/diff/1/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart#newcode71 pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:71: file.delete(); Do we want to decrease the size ...
4 years, 1 month ago (2016-11-10 22:12:05 UTC) #3
Paul Berry
On 2016/11/10 22:00:37, scheglov wrote: IMHO this approach has several problems: 1. At startup time ...
4 years, 1 month ago (2016-11-10 22:24:43 UTC) #4
scheglov
On 2016/11/10 22:24:43, Paul Berry wrote: > On 2016/11/10 22:00:37, scheglov wrote: > > IMHO ...
4 years, 1 month ago (2016-11-11 17:18:40 UTC) #5
Paul Berry
On 2016/11/11 17:18:40, scheglov wrote: > On 2016/11/10 22:24:43, Paul Berry wrote: > > On ...
4 years, 1 month ago (2016-11-11 17:30:21 UTC) #6
scheglov
PTAL
4 years, 1 month ago (2016-11-11 20:20:08 UTC) #7
Brian Wilkerson
lgtm
4 years, 1 month ago (2016-11-11 21:56:34 UTC) #8
Paul Berry
lgtm https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right): https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart#newcode23 pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:23: int _currentSizeBytes = 0; Rename this to something ...
4 years, 1 month ago (2016-11-13 15:18:17 UTC) #9
scheglov
https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right): https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart#newcode23 pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:23: int _currentSizeBytes = 0; On 2016/11/13 15:18:17, Paul Berry ...
4 years, 1 month ago (2016-11-14 16:51:47 UTC) #10
scheglov
Committed patchset #2 (id:20001) manually as 89eabc80836b25ce79c1c085d8280225d667cb89 (presubmit successful).
4 years, 1 month ago (2016-11-14 16:53:39 UTC) #12
Paul Berry
https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right): https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart#newcode98 pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:98: args[2] is SendPort) { On 2016/11/14 16:51:47, scheglov wrote: ...
4 years, 1 month ago (2016-11-14 21:19:29 UTC) #13
rmacnak
On 2016/11/14 21:19:29, Paul Berry wrote: > https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart > File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right): > > https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart#newcode98 ...
4 years, 1 month ago (2016-11-14 23:29:28 UTC) #14
Paul Berry
4 years, 1 month ago (2016-11-14 23:36:31 UTC) #15
Message was sent while issue was closed.
On 2016/11/14 23:29:28, rmacnak wrote:
> On 2016/11/14 21:19:29, Paul Berry wrote:
> >
>
https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/da...
> > File pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart (right):
> > 
> >
>
https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/da...
> > pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:98: args[2] is
> SendPort)
> > {
> > On 2016/11/14 16:51:47, scheglov wrote:
> > > On 2016/11/13 15:18:17, Paul Berry wrote:
> > > > It seems weird to send a list of objects to the isolate.  Why not put
> > > cachePath,
> > > > maxSizeBytes, and replyTo into a class and then transfer an object of
that
> > > type
> > > > across the isolate?
> > > 
> > > Unfortunately this does not work.
> > > 
> > > SendPort.send says that:
> > > 
> > >    * The content of [message] can be: primitive values (null, num, bool,
> > double,
> > >    * String), instances of [SendPort], and lists and maps whose elements
are
> > any
> > >    * of these. List and maps are also allowed to be cyclic.
> > > 
> > > It also says that it should be possible to send objects.
> > > 
> > >    * In the special circumstances when two isolates share the same code
and
> > are
> > >    * running in the same process (e.g. isolates created via
> [Isolate.spawn]),
> > it
> > >    * is also possible to send object instances (which would be copied in
the
> > >    * process). This is currently only supported by the dartvm.  For now,
the
> > >    * dart2js compiler only supports the restricted messages described
above.
> > > 
> > > 
> > > But it does not work.
> > > I still get an exception when I try to send an object.
> > > Invalid argument(s): Invalid object found in message.
> > 
> > +rmacnak, is this due to a bug in the VM?
> 
> How was the second isolate created? You can only send general objects to an
> isolate created with spawnFunction, not spawnUri.

I assume by spawnFunction, you mean Isolate.spawn()?  (There is no
Isolate.spawnFunction()).

It was created with Isolate.spawn().  See
https://codereview.chromium.org/2492933002/diff/20001/pkg/analyzer/lib/src/da...
line 65.

Powered by Google App Engine
This is Rietveld 408576698