Bug #5254

provenance database connections keep growing when using Reporting suite.

Added by jianwu jianwu almost 12 years ago. Updated almost 12 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Every time a window is open, or a workflow is saved, running, a separate db connection is gotten. but they are not released when a window is closed. It will cause memory usage goes up.

We guess WorkflowRunManager.disconnect() should call SQLQueryV8.disconnect() to close the connection. Currently, SQLQueryV8.disconnect() is not called by any classes.

If we can reuse existing connections. The performance will be better than creating and closing a new one.

This is one stack trace for db connection when a window is open:

DatabaseFactory.getConnectedDatabaseType(Map<String,String>, String) line: 154
SQLQueryV8.<init>(Map<String,String>) line: 77
WorkflowRunManager.connect() line: 135
WorkflowRunManagerPanel.reconnect() line: 960
WorkflowRunManagerPanel.resetProvenanceInfo(ProvenanceStore) line: 937
WorkflowRunManagerPanel.initializeTab() line: 231
TabPaneFactory.createTabPaneTabs(TableauFrame) line: 110
TabManager.initializeTabs(TableauFrame) line: 87
KeplerGraphFrame._initBasicGraphFrame() line: 377
KeplerGraphFrame(BasicGraphFrame).<init>(NamedObj, Tableau, LibraryAttribute) line: 224
KeplerGraphFrame(ExtendedGraphFrame).<init>(CompositeEntity, Tableau, LibraryAttribute) line: 95
KeplerGraphFrame(ActorGraphFrame).<init>(CompositeEntity, Tableau, LibraryAttribute) line: 135
KeplerGraphFrame.<init>(CompositeEntity, Tableau, LibraryAttribute) line: 180
KeplerGraphTableau.<init>(PtolemyEffigy, String, LibraryAttribute) line: 164
KeplerGraphTableau$Factory.createTableau(Effigy) line: 227
PtolemyTableauFactory.createTableau(Effigy) line: 100
TableauFactory.createTableau(Effigy) line: 127
Configuration.createPrimaryTableau(Effigy) line: 569
TableauFrame$1.actionPerformed(ActionEvent) line: 519

Related issues

Blocked by Kepler - Bug #5095: test kepler and wrp for memory leaksIn Progress07/14/2010


#1 Updated by Derik Barseghian almost 12 years ago

The first execution in any new window makes a new db connection. This is because a new SQLRecordingV8 is created for each new window (with _needReconnectDB set to true).
ProvenanceRecorder.attributeChanged() calls ProvenanceRecorder._changeRecordingType() which constructs the new SQLRecordingV8 with: newObj = rec.newInstance();

Should these connections instead come from a shared pool?

In r26477 I made a change to WorkflowRunManagerPanel so it hopefully doesn't reconnect when unnecessary.

I need to look more for other unnecessary connections, and re: proper disconnection...

#2 Updated by Derik Barseghian almost 12 years ago

Jianwu tested this after my change, and he says he doesn't see the number of connections increasing for new windows or other events and that we can close this now.

#3 Updated by Redmine Admin over 9 years ago

Original Bugzilla ID was 5254

Also available in: Atom PDF