Control java task `Xmx` heap size option with $task.memory

172 views
Skip to first unread message

Ralf G

unread,
Feb 3, 2021, 7:36:52 AM2/3/21
to Nextflow
Hi,

I would like to control the heap size of a java process using the $task.memory implicit variable:
java -Djava.awt.headless=true -Xmx$task.memory -jar <path/to/jar>

However, $task.memory would return "20 GB", including a space and the unit including "B", which is not what the java -Xmx option expects ("20g" or "20G"). 

How could I solve this?

Thanks!

Paolo Di Tommaso

unread,
Feb 3, 2021, 8:01:59 AM2/3/21
to nextflow
You can use the properties .bytes, .kilo, .mega, .giga the memory using the required unit eg. `task.memory.giga` 


p

--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nextflow/27c9ba7e-cb4b-4da0-b92f-5d0570c585b2n%40googlegroups.com.

Ralf G

unread,
Feb 3, 2021, 10:27:49 AM2/3/21
to Nextflow
That's great! Did not know these properties existed. Thanks for the quick reply!
Reply all
Reply to author
Forward
0 new messages