Need to be able to shut down the WeakCollectionCleaner

Description

We have a web start application (and/or applet) that uses geotools and when we log out of our application we want to free up memory.
Since our application is quite big as it is we have our own class loader, one per login session. This classloader will load geotools on demand (and similar for our other classes).
When we log out we drop our references to this class loader, but this class loader (and its classes) can not be dropped fully since the WeakCollectionCleaner is still running.

How do we shut this org.geotools.util.WeakCollectionCleaner down?

When I look at the source I also find a copy of this class called org.geotools.data.directory.ReferenceCleaner, but I do not think our code ever touches that one.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:15 PM

CodeHaus Comment From: robert.olofsson - Time: Mon, 18 Jan 2010 01:30:09 -0600
---------------------
The last patch is looking almost ok, but it is not correct.

Since there is no syncrhonization event when nulling or reading referenceQueue there is no guarantee that the

thread in run() will see the new null-value.

The patch will probably work in practice during tests, but fail from time to time.

codehaus
April 10, 2015, 3:15 PM

CodeHaus Comment From: robert.olofsson - Time: Mon, 18 Jan 2010 01:31:08 -0600
---------------------
Reopen so that we can get the multi thread issue corrected.

codehaus
April 10, 2015, 3:15 PM

CodeHaus Comment From: aaime - Time: Mon, 18 Jan 2010 01:34:04 -0600
---------------------
Care to provide a fixed version then?

codehaus
April 10, 2015, 3:15 PM

CodeHaus Comment From: robert.olofsson - Time: Mon, 18 Jan 2010 02:59:07 -0600
---------------------
This patch hopefully fixes thread related problems (applies on top of trunk).

There is still the question of the other copy/pasted class: org.geotools.data.directory.ReferenceCleaner.

codehaus
April 10, 2015, 3:15 PM

CodeHaus Comment From: aaime - Time: Mon, 18 Jan 2010 03:12:49 -0600
---------------------
Thanks for the patch, applied.

The other class has been removed at r34806 on Friday.

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Fix versions

Affects versions

Priority

Medium
Configure