]> source.dussan.org Git - vaadin-framework.git/commit
Avoid leaking memory from inherited ThreadLocales. Fixes #12401
authorJonatan Kronqvist <jonatan@vaadin.com>
Wed, 28 Aug 2013 10:53:45 +0000 (13:53 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 2 Sep 2013 09:41:39 +0000 (09:41 +0000)
commite6af0f0a5a1333d06e18d0149d44231a5f8e654d
tree4c0db65d396d318c20c69bfca65d6b16c9ce31ea
parentd8b0b504894255543e68f074b30051a91f8a1154
Avoid leaking memory from inherited ThreadLocales. Fixes #12401

The issue is fixed by changing the normal HashMap inside the inheritable
thread local to a map implementation holding only weak references to the
values (WeakValueMap).

Also included is a test UI that starts threads, which run until the JVM
is quit. This along with VisualVM was used to reproduce the issue and
verify the fix.

Change-Id: I116cc4e56e8a19c3b770abab6b18b9e262f4dafa
server/src/com/vaadin/util/CurrentInstance.java
server/src/com/vaadin/util/WeakValueMap.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/performance/ThreadMemoryLeaksTest.java [new file with mode: 0644]