Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
   Disable the use of the Java5 memory monitoring as the default.
   Users must determine what the correct value of the mondrian property:
   "mondrian.util.memoryMonitor.percentage.threshold"
   based upon their environment.

[git-p4: depot-paths = "//open/mondrian/": change = 8666]
  • Loading branch information
Richard Emberson committed Feb 5, 2007
1 parent e698239 commit e5eeefe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mondrian.properties
Expand Up @@ -276,7 +276,7 @@ mondrian.rolap.iterationLimit=0
###############################################################################
# Whether the MemoryMonitor should be enabled. By
# default for Java5 and above it is enabled.
mondrian.util.memoryMonitor.enable=true
mondrian.util.memoryMonitor.enable=false

###############################################################################
# The default MemoryMonitor percentage threshold.
Expand Down
4 changes: 2 additions & 2 deletions src/main/mondrian/olap/MondrianProperties.java
Expand Up @@ -852,10 +852,10 @@ public Property getPropertyDefinition(String path) {

/**
* Whether the <code>MemoryMonitor</code> should be enabled. By
* default for Java5 and above it is enabled.
* default for Java5 and above it is not enabled.
*/
public final BooleanProperty MemoryMonitor = new BooleanProperty(
this, "mondrian.util.memoryMonitor.enable", true);
this, "mondrian.util.memoryMonitor.enable", false);

/**
* The default <code>MemoryMonitor</code> percentage threshold.
Expand Down
17 changes: 13 additions & 4 deletions testsrc/main/mondrian/util/MemoryMonitorTest.java
Expand Up @@ -12,6 +12,7 @@

import mondrian.test.*;
import mondrian.olap.Connection;
import mondrian.olap.MondrianProperties;
import mondrian.olap.Result;
import mondrian.olap.Util;
import mondrian.olap.MemoryLimitExceededException;
Expand All @@ -25,16 +26,24 @@
* @author Richard Emberson
*/
public class MemoryMonitorTest extends FoodMartTestCase {
protected boolean enabled;
public MemoryMonitorTest() {
super();
}
public MemoryMonitorTest(String name) {
super(name);
}

protected void setUp() throws Exception {
super.setUp();
enabled = MondrianProperties.instance().MemoryMonitor.get();
}
protected void tearDown() throws Exception {
super.tearDown();
}

public void testZeroUsage() throws Exception {
if (Util.PreJdk15) {
if (Util.PreJdk15 || !enabled) {
return;
}
class Listener implements MemoryMonitor.Listener {
Expand All @@ -59,7 +68,7 @@ public void memoryUsageNotification(long used, long max) {
}
}
public void testDeltaUsage() throws Exception {
if (Util.PreJdk15) {
if (Util.PreJdk15 || !enabled) {
return;
}
class Listener implements MemoryMonitor.Listener {
Expand Down Expand Up @@ -104,7 +113,7 @@ public void memoryUsageNotification(long used, long max) {
}
}
public void testUpdatePercent() throws Exception {
if (Util.PreJdk15) {
if (Util.PreJdk15 || !enabled) {
return;
}
class Listener implements MemoryMonitor.Listener {
Expand Down Expand Up @@ -148,7 +157,7 @@ public void memoryUsageNotification(long used, long max) {
}
}
public void testQuery() throws Exception {
if (Util.PreJdk15) {
if (Util.PreJdk15 || !enabled) {
return;
}
class Listener implements MemoryMonitor.Listener {
Expand Down

0 comments on commit e5eeefe

Please sign in to comment.