When setting the HEAPSIZE option in the /home/tdm/.tdm/conf/fdm/global_options.txt file, the Docker version of TDM Portal fails to load this option, and uses the default heaps size instead.
TDM Portal Docker - all supported releases
The HEAPSIZE option is used by the Java framework and not by FDM itself/
Simply put, it cannot be implemented and will never work in the local options, or global options file. This is also the reason why you won't find this option listed among the masking options in the TDM documentation.
The recommendation is to use JAVA_OPTS environment variable of the Docker pod and set the option there. It could look like JAVA_OPTS="-Xms128m -Xmx512m" (Xms is minimum heap size, Xmx is maximum heap size). Of course this suggestion will change the heap size for every masking job.
In fact, this can be simply achieved by modifying the masking compose file and setting the value of JAVA_MAX_MEMORY there.