mirror of https://github.com/apache/activemq.git
additional fix for: https://issues.apache.org/jira/browse/AMQ-3573
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1235325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dbc661fd9b
commit
7b90f4178f
|
@ -1678,29 +1678,40 @@ public class BrokerService implements Service {
|
|||
SystemUsage usage = getSystemUsage();
|
||||
long memLimit = usage.getMemoryUsage().getLimit();
|
||||
long jvmLimit = Runtime.getRuntime().maxMemory();
|
||||
if (memLimit > jvmLimit){
|
||||
LOG.error("Memory Usage for the Broker (" + memLimit/(1024*1024) + " mb) is more than the maximum available for the JVM: " + jvmLimit/(1024*1024) + " mb" );
|
||||
if (memLimit > jvmLimit) {
|
||||
LOG.error("Memory Usage for the Broker (" + memLimit / (1024 * 1024) +
|
||||
" mb) is more than the maximum available for the JVM: " +
|
||||
jvmLimit / (1024 * 1024) + " mb");
|
||||
}
|
||||
if (getPersistenceAdapter() != null){
|
||||
if (getPersistenceAdapter() != null) {
|
||||
File dir = getPersistenceAdapter().getDirectory();
|
||||
if (dir != null){
|
||||
if (dir != null) {
|
||||
long storeLimit = usage.getStoreUsage().getLimit();
|
||||
long dirFreeSpace = dir.getFreeSpace();
|
||||
if (storeLimit > dirFreeSpace){
|
||||
LOG.warn("Store limit is " + storeLimit/(1024*1024) + " mb, whilst the data directory: " + dir.getAbsolutePath() + " only has " + dirFreeSpace/(1024*1024) + " mb of free space");
|
||||
if (storeLimit > dirFreeSpace) {
|
||||
LOG.warn("Store limit is " + storeLimit / (1024 * 1024) +
|
||||
" mb, whilst the data directory: " + dir.getAbsolutePath() +
|
||||
" only has " + dirFreeSpace / (1024 * 1024) + " mb of free space");
|
||||
}
|
||||
}
|
||||
}
|
||||
File tmpDir = getTmpDataDirectory();
|
||||
if (tmpDir != null){
|
||||
if (tmpDir != null) {
|
||||
|
||||
String tmpDirPath = tmpDir.getAbsolutePath();
|
||||
if (!tmpDir.isAbsolute()) {
|
||||
tmpDir = new File(tmpDirPath);
|
||||
}
|
||||
|
||||
long storeLimit = usage.getTempUsage().getLimit();
|
||||
while (tmpDir != null && tmpDir.isDirectory()== false){
|
||||
while (tmpDir != null && tmpDir.isDirectory() == false) {
|
||||
tmpDir = tmpDir.getParentFile();
|
||||
}
|
||||
long dirFreeSpace = tmpDir.getUsableSpace();
|
||||
if (storeLimit > dirFreeSpace){
|
||||
LOG.error("Temporary Store limit is " + storeLimit/(1024*1024) + " mb, whilst the temporary data directory: " + tmpDirPath + " only has " + dirFreeSpace/(1024*1024) + " mb of free space");
|
||||
if (storeLimit > dirFreeSpace) {
|
||||
LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) +
|
||||
" mb, whilst the temporary data directory: " + tmpDirPath +
|
||||
" only has " + dirFreeSpace / (1024 * 1024) + " mb of free space");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue