Skip to content

Commit

Permalink
Add more no_ice cutout points.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkraljevic committed May 25, 2015
1 parent f527cfc commit 19ed22e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/water/H2O.java
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,11 @@ public static void main( String[] args ) {
Log.info("Opted out of sending usage metrics.");
}

if (OPT_ARGS.no_ice) {
// Cleaner callback happens in a different classloader. Do this so they can share the state info.
System.setProperty("h2o.args.no_ice", "true");
}

if (OPT_ARGS.baseport != 0) {
DEFAULT_PORT = OPT_ARGS.baseport;
}
Expand Down Expand Up @@ -1612,11 +1617,19 @@ static boolean lazyPersist(){ // free disk > our DRAM?
return !H2O.OPT_ARGS.no_ice && H2O.SELF._heartbeat.get_free_disk() > MemoryManager.MEM_MAX;
}
static boolean isDiskFull(){ // free disk space < 5K?
if (H2O.OPT_ARGS.no_ice) {
return true;
}

long space = Persist.getIce().getUsableSpace();
return space != Persist.UNKNOWN && space < (5 << 10);
}

@Override public void run() {
if (H2O.OPT_ARGS.no_ice) {
return;
}

boolean diskFull = false;
while( true ) {
// Sweep the K/V store, writing out Values (cleaning) and free'ing
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/water/MemoryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ private static class HeapUsageMonitor implements javax.management.NotificationLi
* Limit to touching global vars in the Boot class.
*/
public void handleNotification(Notification notification, Object handback) {
if (System.getProperty("h2o.args.no_ice") != null) {
return;
}

String notifType = notification.getType();
if( notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
// Memory used after this FullGC
Expand Down

0 comments on commit 19ed22e

Please sign in to comment.