Add option to command line for setting memory allowed
This commit is contained in:
@@ -67,6 +67,9 @@ public class Worker {
|
|||||||
@Option(name = "-cores", usage = "Number of cores/threads to use for the render", metaVar = "3", required = false)
|
@Option(name = "-cores", usage = "Number of cores/threads to use for the render", metaVar = "3", required = false)
|
||||||
private int nb_cores = -1;
|
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;
|
||||||
|
|
||||||
@Option(name = "--verbose", usage = "Display log", required = false)
|
@Option(name = "--verbose", usage = "Display log", required = false)
|
||||||
private boolean print_log = false;
|
private boolean print_log = false;
|
||||||
|
|
||||||
@@ -198,6 +201,10 @@ public class Worker {
|
|||||||
config.setUseNbCores(nb_cores);
|
config.setUseNbCores(nb_cores);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (max_ram > 0) {
|
||||||
|
config.setMaxMemory(max_ram * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
if (method != null) {
|
if (method != null) {
|
||||||
try {
|
try {
|
||||||
compute_method = ComputeType.valueOf(method);
|
compute_method = ComputeType.valueOf(method);
|
||||||
|
|||||||
Reference in New Issue
Block a user