NIHVIVO-719 set names on all created Threads, to help in diagnosing memory leaks.

This commit is contained in:
jeb228 2010-12-16 20:44:17 +00:00
parent 4c862f846d
commit df7047065d
5 changed files with 7 additions and 6 deletions

View file

@ -275,6 +275,7 @@ public class BrowseController extends VitroHttpServlet {
private boolean awareOfQueueChange = false; private boolean awareOfQueueChange = false;
RebuildGroupCacheThread(BrowseController controller) { RebuildGroupCacheThread(BrowseController controller) {
super("RebuildGroupCacheThread");
this.controller = controller; this.controller = controller;
} }
public void run() { public void run() {

View file

@ -49,7 +49,7 @@ public class MemToRDBModelSynchronizer extends StatementListener {
lastEditTimeMillis = System.currentTimeMillis(); lastEditTimeMillis = System.currentTimeMillis();
this.editInProgress = false; this.editInProgress = false;
if (!cleanupThreadActive) { if (!cleanupThreadActive) {
(new Thread(new Cleanup(this))).start(); (new Thread(new Cleanup(this), "MemToRDBModelSynchronizer")).start();
} }
} }
} }
@ -63,7 +63,7 @@ public class MemToRDBModelSynchronizer extends StatementListener {
lastEditTimeMillis = System.currentTimeMillis(); lastEditTimeMillis = System.currentTimeMillis();
this.editInProgress = false; this.editInProgress = false;
if (!cleanupThreadActive) { if (!cleanupThreadActive) {
(new Thread(new Cleanup(this))).start(); (new Thread(new Cleanup(this), "MemToRDBModelSynchronizer")).start();
} }
} }
} }

View file

@ -282,6 +282,7 @@ public class VClassGroupCache implements ServletContextListener{
private boolean awareOfQueueChange = false; private boolean awareOfQueueChange = false;
RebuildGroupCacheThread(VClassGroupCache cache) { RebuildGroupCacheThread(VClassGroupCache cache) {
super("VClassGroupCache.RebuildGroupCacheThread");
this.cache = cache; this.cache = cache;
} }
public void run() { public void run() {

View file

@ -428,7 +428,7 @@ public class PelletListener implements ModelChangedListener {
if (foreground) { if (foreground) {
(new InferenceGetter(this)).run(); (new InferenceGetter(this)).run();
} else { } else {
new Thread(new InferenceGetter(this)).start(); new Thread(new InferenceGetter(this), "PelletListener.InferenceGetter").start();
} }
} }
} }
@ -625,7 +625,7 @@ public class PelletListener implements ModelChangedListener {
if (foreground) { if (foreground) {
(new PelletSynchronizer()).run(); (new PelletSynchronizer()).run();
} else { } else {
new Thread(new PelletSynchronizer()).start(); new Thread(new PelletSynchronizer(), "PelletListener.PelletSynchronizer").start();
} }
} }
} }

View file

@ -14,7 +14,6 @@ import org.openrdf.model.impl.URIImpl;
import org.openrdf.repository.Repository; import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection; import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException; import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.RepositoryResult;
import org.openrdf.repository.http.HTTPRepository; import org.openrdf.repository.http.HTTPRepository;
import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFParseException; import org.openrdf.rio.RDFParseException;
@ -47,7 +46,7 @@ public class SesameSyncUtils {
PipedInputStream in = new PipedInputStream(); PipedInputStream in = new PipedInputStream();
PipedOutputStream out = new PipedOutputStream(in); PipedOutputStream out = new PipedOutputStream(in);
try { try {
new Thread((new JenaOutputter(jenaModel, out))).start(); new Thread(new JenaOutputter(jenaModel, out), "SesameSyncUtilities.JenaOutputter").start();
if (contextRes != null) { if (contextRes != null) {
myConn.add(in,"http://example.org/base/", RDFFormat.NTRIPLES, contextRes); myConn.add(in,"http://example.org/base/", RDFFormat.NTRIPLES, contextRes);
} else { } else {