Skip to content
Snippets Groups Projects
Commit 8026edc1 authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Single source of truth for model heap size.

[Refactor][Toolbox]
parent 266bd2c6
Branches
Tags
No related merge requests found
......@@ -7,6 +7,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.internal.IPreferenceConstants;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.lamport.tla.toolbox.tool.tlc.TLCActivator;
import org.lamport.tla.toolbox.tool.tlc.job.TLCProcessJob;
import org.lamport.tla.toolbox.tool.tlc.ui.TLCUIActivator;
import org.osgi.service.prefs.BackingStoreException;
......@@ -20,7 +21,7 @@ import tlc2.tool.fp.FPSetFactory;
public class TLCPreferenceInitializer extends AbstractPreferenceInitializer
{
public static final int MAX_HEAP_SIZE_DEFAULT = 25;
public static final int MAX_HEAP_SIZE_DEFAULT = TLCProcessJob.HEAP_SIZE_DEFAULT;
/**
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
......
......@@ -41,6 +41,7 @@ import util.TLCRuntime;
*/
public class TLCProcessJob extends TLCJob
{
public static final int HEAP_SIZE_DEFAULT = 25;
protected IProcess process = null;
private BroadcastStreamListener listener = null;
......@@ -100,7 +101,7 @@ public class TLCProcessJob extends TLCJob
final List<String> vmArgs = new ArrayList<String>();
// get max heap size as fraction from model editor
final double maxHeapSize = launch.getLaunchConfiguration().getAttribute(LAUNCH_MAX_HEAP_SIZE, 50) / 100d;
final double maxHeapSize = launch.getLaunchConfiguration().getAttribute(LAUNCH_MAX_HEAP_SIZE, HEAP_SIZE_DEFAULT) / 100d;
final TLCRuntime instance = TLCRuntime.getInstance();
long absolutePhysicalSystemMemory = instance.getAbsolutePhysicalSystemMemory(maxHeapSize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment