Memory amount should be in long not int

This commit is contained in:
Laurent Clouet
2019-02-20 13:46:53 +01:00
parent 6d9ca8ef2c
commit 208f49ba1d
10 changed files with 25 additions and 25 deletions

View File

@@ -73,7 +73,7 @@ public class Worker {
private int nb_cores = -1;
@Option(name = "-memory", usage = "Maximum memory allow to be used by renderer (in MB)", required = false)
private int max_ram = -1;
private long max_ram = -1;
@Option(name = "-rendertime", usage = "Maximum time allow for each frame (in minute)", required = false)
private int max_rendertime = -1;

View File

@@ -256,7 +256,7 @@ public class Settings implements Activity {
// max ram allowed to render
OS os = OS.getOS();
int all_ram = os.getMemory();
int all_ram = (int) os.getMemory();
ram = new JSlider(0, all_ram);
int step = 1000000;
double display = (double)all_ram / (double)step;
@@ -272,7 +272,7 @@ public class Settings implements Activity {
ram.setLabelTable(labelTable);
ram.setPaintTicks(true);
ram.setPaintLabels(true);
ram.setValue(config.getMaxMemory() != -1 ? config.getMaxMemory() : os.getMemory());
ram.setValue((int)(config.getMaxMemory() != -1 ? config.getMaxMemory() : os.getMemory()));
JLabel ramLabel = new JLabel("Memory:");
compute_devices_constraints.weightx = 1.0 / gpus.size();
@@ -558,7 +558,7 @@ public class Settings implements Activity {
config.setUseNbCores(cpu_cores);
}
int max_ram = -1;
long max_ram = -1;
if (ram != null) {
max_ram = ram.getValue();
}