Cannot Terminate a Thread if there is a new Workspace

Visual manipulations and refinements
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
thecoolboy
Posts:51
Joined:12 Oct 2011 23:01
Location:Arkansas,USA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Cannot Terminate a Thread if there is a new Workspace

Post by thecoolboy » 25 Apr 2013 02:06

I am writing a simulation program and importing 20-30 gdf files. But after a point it gives me outofmemoryexception.

Here is my code:

private void GetGraphFromGDFFile(String fileDir,String fileName){

//Init a project - and therefore a workspace
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.closeCurrentProject();
pc.newProject();
Workspace workspace = pc.getCurrentWorkspace();

//Import file
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
Container container;
try {

File file = new File(fileDir+fileName+".gdf");
container = importController.importFile(file);
container.getLoader().setEdgeDefault(EdgeDefault.UNDIRECTED); //Force DIRECTED

DynamicProcessor dynamicProcessor = new DynamicProcessor();
dynamicProcessor.setDateMode(false); //Set 'true' if you set real dates (ex: yyyy-mm-dd), it's double otherwise
dynamicProcessor.setLabelmatching(false); //Set 'true' if node matching is done on labels instead of ids

//Set date for this file
dynamicProcessor.setDate("2013");

importController.process(container, dynamicProcessor, workspace);


} catch (Exception ex) {
ex.printStackTrace();
return;
}

}


Assume that I call this function for many times. I think I am experiencing the same problems here: http://forum.gephi.org/viewtopic.php?t=2242

Closing a project or removing a workspace doesn't terminate the current thread.

After getting that graph, I need to terminate that thread. It seems that is a bug of the version 0.8 but please give me a trick to do that without having to get the newer version!

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable