public long getMemorySetting() { if (IJ.getApplet()!=null) return 0L; long max = 0L; if (IJ.isMacOSX()) { String appPath = System.getProperty("java.class.path"); if (appPath==null) return 0L; int index = appPath.indexOf(".app/"); if (index==-1) return 0L; appPath = appPath.substring(0,index+5); max = getMemorySetting(appPath+"Contents/Info.plist"); } else max = getMemorySetting("ImageJ.cfg"); return max; }
public long getMemorySetting() { if (IJ.getApplet()!=null) return 0L; long max = 0L; if (IJ.isMacOSX()) { String appPath = System.getProperty("java.class.path"); if (appPath==null) return 0L; int index = appPath.indexOf(".app/"); if (index==-1) return 0L; appPath = appPath.substring(0,index+5); max = getMemorySetting(appPath+"Contents/Info.plist"); } else max = getMemorySetting("ImageJ.cfg"); return max; }
/** Returns the maximum amount of memory available to ImageJ or zero if ImageJ is unable to determine this limit. */ public static long maxMemory() { if (maxMemory==0L) { Memory mem = new Memory(); maxMemory = mem.getMemorySetting(); if (maxMemory==0L) maxMemory = mem.maxMemory(); } return maxMemory; }
/** Returns the maximum amount of memory available to ImageJ or zero if ImageJ is unable to determine this limit. */ public static long maxMemory() { if (maxMemory==0L) { Memory mem = new Memory(); maxMemory = mem.getMemorySetting(); if (maxMemory==0L) maxMemory = mem.maxMemory(); } return maxMemory; }
void changeMemoryAllocation() { int max = (int)(getMemorySetting()/1048576L); boolean unableToSet = max==0; if (max==0) max = (int)(maxMemory()/1048576L);
void changeMemoryAllocation() { int max = (int)(getMemorySetting()/1048576L); boolean unableToSet = max==0; if (max==0) max = (int)(maxMemory()/1048576L);