Closed GoogleCodeExporter closed 8 years ago
This also seems to destroy the semantic of weakValues().
To reproduce:
1. Remove "(expected = OutOfMemoryError.class)" from the test case.
2.a. remove expiration() and and add weakValues()
ConcurrentMap<String, String> map = new MapMaker().weakValues().makeMap();
Observed: Works, no OOME.
2.b. Leave expiration() in place and add weakValues()
ConcurrentMap<String, String> map = new MapMaker().weakValues().expiration(3600,
TimeUnit.SECONDS).makeMap();
Observed: OOME (even though weakValues() was used!) What is more the number of
entries that
can be stored in this way does not differ much from not using weakValues() at
all. In my test
the combination weakValues/expiration adds ~ 550K while a normal "new
MapMaker().makeMap()"-
map adds ~ 450K.
Original comment by woid...@gmail.com
on 14 Dec 2009 at 3:46
This issue has been moved to the Guava project (keeping the same id number).
Simply replace 'google-collections' with 'guava-libraries' in your address
bar and it should take you there.
Original comment by kevinb@google.com
on 5 Jan 2010 at 11:09
Original issue reported on code.google.com by
woid...@gmail.com
on 14 Dec 2009 at 3:30Attachments: