How to set JVM parameters for a child Job called using the tRunJob component


How can I increase the Java max heap size (-Xmx) of a Job calling a child Job with the tRunJob component? Setting -Xmx in JobServer does not seem to have an effect.



Any JVM setting you set in JobServer only applies to the JobServer process. Jobs (parent and child) themselves are run from different JVM processes.


From TAC, select the task of the main Job, then select the JVM parameters tab. Click Add to set the JVM options without rebuilding or redeploying the task:



However, this only applies to the main/parent Job and any child Job where the tRunJob component is not set to run as new/independent process.


If the tRunJob component is set to run as new/independent process, you need to set the JVM at the Job level. Open the child Job in the Run view, click the Advanced settings tab, then select the Use specific JVM arguments checkbox and set the JVM options.




To set this globally, at a Project level, so that it applies to all Jobs: from Studio, navigate to Window > Preferences > Talend > Run/Debug > Job Run VM arguments.



Version history
Revision #:
10 of 10
Last update:
‎04-14-2019 02:30 AM
Updated by:
Seven Stars

Firstly, the preferences do not apply at the project level, they apply at the workspace level i.e. any job without specific JVM arguments, from any project in that workspace for the studio, will use those from the preferences as defaults.  So if you've changed the preferences but recreate or change your workspace then all preferences will revert to the defaults the studio ships with.


Secondly, for the same reason, those preferences do not apply to any job run from TAC.  A task in TAC that does not have specific JVM arguments in the (studio) job design or the (TAC) Job Conductor will use those set in the command-line workspace preferences at the time the command-line was last started before the task was generated.


Note that preferences are not externalised to a file on installation so you have to assume those for the command-line will be the same as you see in the studio (Talend has changed the defaults in the past) or set them yourself.  To set the JVM argument preferences for the command-line, place a file called "org.talend.designer.runprocess.prefs" in the "{commandline workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings" folder, containing the (example) line "vmarguments=\ -Xms256M -Xmx1024M " and restart the command-line service.