Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

memory problems by using qc ota over jacob

$
0
0

Hello,

 

I use follow code to get certain tickets with a java thread every 30 minutes. Sporadically a get a heap memory although i set the java heap to 1,4 GB. Propably i forgot something to close/clean up. 

Please help.

 

 

public Dispatch connection;

	private Dispatch bugFactory;

	ComThread.InitMTA();

	connection = new Dispatch("TDApiole80.TDConnection");

	if (connection == null) {
		stuff....
	}

	Dispatch.call(connection, "InitConnectionEx", Configuration.getQcServerUrl());

	String usr = Configuration.getQcUsername();
	String pw = ShiffCode.getValueForText(Configuration.getQcPassword());

	// Login into QualityCenter
		
	Dispatch.call(connection, "Login", usr, pw);
	Dispatch.call(connection, "Connect", Configuration.getQcDomain(), Configuration.getQcProject());
	bugFactory = Dispatch.get(connection, "BugFactory").toDispatch();
public Collection<QcIssue> getAll() {
		Collection<QcIssue> issues = new ArrayList<QcIssue>();
		QcIssue qcIssue;

		logger.debug("Dispatch call newlist");
		Dispatch bugs = Dispatch.call(bugFactory, "NewList", Configuration.getQcFilterQuery()).toDispatch();

		logger.debug("Dispatch call count");
		int count = Dispatch.get(bugs, "Count").changeType(Variant.VariantInt).getInt();
		for (int i = 0; i < count; i++) {
			Dispatch bug = Dispatch.call(bugs, "Item", i + 1).toDispatch();
			qcIssue = new QcIssue(this, bug);
			issues.add(qcIssue);
		}
		return issues;
	}

 

public void shutdown() {
		try {
			logger.info("Disconnect from QC Project...");
			Dispatch.call(connection, "DisconnectProject");
			logger.info("Release QC Connection...");
			Dispatch.call(connection, "ReleaseConnection");

			bugFactory = null;
			connection = null;

			Thread finisher = new Thread() {
				@Override
				public void run() {
					logger.info("Run Finalizer...");
					System.runFinalization();
					System.gc();
				}
			};

			finisher.start();
			try {
				finisher.join();
				logger.info("Waiting for Finalization...");
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			logger.info("Finalizer finished!");
			ComThread.Release();
			logger.info("COM Thread released!");

		}

		catch (Exception e) {
			logger.warn("Error during closing QC connection", e);
		}

	}

 


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>