/** * Creates a new instance of <code>InternalDistributedSystem</code> * with the given configuration. */ public static InternalDistributedSystem newInstance(Properties config) { boolean success = false; InternalDataSerializer.checkSerializationVersion(); try { SystemFailure.startThreads(); InternalDistributedSystem newSystem = new InternalDistributedSystem(config); newSystem.initialize(); reconnectAttemptCounter = 0; // reset reconnect count since we just got a new connection notifyConnectListeners(newSystem); success = true; return newSystem; } finally { if (!success) { LogWriterImpl.cleanUpThreadGroups(); // bug44365 - logwriters accumulate, causing mem leak SystemFailure.stopThreads(); } } }
/** * Deregisters everything this Agent registered and releases the MBeanServer. */ public void stop() { try { this.logWriter.info(LocalizedStrings.AgentImpl_STOPPING_JMX_AGENT); this.logWriter.shuttingDown(); // stop the GemFire Distributed System stopDistributedSystem(); // stop all JMX Adaptors and Connectors... stopHttpAdaptor(); stopRMIConnectorServer(); memberInfoWithStatsMBean = null; stopSnmpAdaptor(); // release the MBeanServer for cleanup... MBeanUtil.stop(); mBeanServer = null; // remove the register shutdown hook which disconnects the Agent from the Distributed System upon JVM shutdown removeShutdownHook(); this.logWriter.info(LocalizedStrings.AgentImpl_AGENT_HAS_STOPPED); } finally { if (this.logFileOutputStream != null) { this.logWriter.closingLogFile(); IOUtils.close(this.logFileOutputStream); } LogWriterImpl.cleanUpThreadGroups(); // bug35388 - logwriters accumulate, causing mem leak } }
LogWriterImpl.cleanUpThreadGroups(); // bug35388 - logwriters accumulate, causing mem leak EventID.unsetDS(); InternalBridgeMembership.unsetLogger();