forked from I2P_Developers/i2p.i2p
* AppContext: Add hasWrapper() method
* Shutdown: - Clear more resources in peer manager, netdb, stat manager, session key manager, naming service, tunnel dispatcher, OCMOSJ (result of testing with jvisualvm) - Don't call wrapper on shutdown (starting two threads) if we were started with runplain
This commit is contained in:
@ -888,4 +888,12 @@ public class I2PAppContext {
|
||||
public InternalClientManager internalClientManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the wrapper present?
|
||||
* @since 0.8.8
|
||||
*/
|
||||
public boolean hasWrapper() {
|
||||
return System.getProperty("wrapper.version") != null;
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
*
|
||||
* If not in router context, the database will be opened read-only
|
||||
* unless the property i2p.naming.blockfile.writeInAppContext is true.
|
||||
* Not designed for simultaneous access by multiple processes.
|
||||
* Not designed for multiple instantiations or simultaneous use by multple JVMs.
|
||||
*
|
||||
* @throws RuntimeException on fatal error
|
||||
*/
|
||||
@ -780,6 +780,7 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
_isClosed = true;
|
||||
}
|
||||
clearCache();
|
||||
}
|
||||
|
||||
/** for logging errors in the static serializers below */
|
||||
|
@ -57,6 +57,12 @@ public class StatManager {
|
||||
_statLog = new BufferedStatLog(context);
|
||||
}
|
||||
|
||||
/** @since 0.8.8 */
|
||||
public void shutdown() {
|
||||
_frequencyStats.clear();
|
||||
_rateStats.clear();
|
||||
}
|
||||
|
||||
/** may be null */
|
||||
public StatLog getStatLog() { return _statLog; }
|
||||
public void setStatLog(StatLog log) {
|
||||
|
@ -77,4 +77,12 @@ public class LogConsoleBuffer {
|
||||
public List<String> getMostRecentCriticalMessages() {
|
||||
return new ArrayList(_critBuffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.8.8
|
||||
*/
|
||||
public void clear() {
|
||||
_buffer.clear();
|
||||
_critBuffer.clear();
|
||||
}
|
||||
}
|
||||
|
@ -660,6 +660,10 @@ public class LogManager {
|
||||
_writer.notifyAll();
|
||||
}
|
||||
}
|
||||
_records.clear();
|
||||
_limits.clear();
|
||||
_logs.clear();
|
||||
_consoleBuffer.clear();
|
||||
}
|
||||
|
||||
private static int __id = 0;
|
||||
|
Reference in New Issue
Block a user