You can set it as JVM arguments the usual way, e.g. -Xms1024m -Xmx2048m
for a minimum heap of 1GB and maximum heap of 2GB. JBoss will use the JAVA_OPTS
environment variable to include additional JVM arguments, you could specify it in the /bin/run.conf.bat
file:
set "JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx2048m"
However, this is more a workaround than a real solution. If multiple users concurrently uploads big files, you'll hit the same problem sooner or later. You would need to keep increasing memory for nothing. You should rather configure your file upload parser to store the uploaded file on temp disk instead of entirely in memory. As long as it's unclear which parser you're using, no suitable answer can be given. However, more than often Apache Commons FileUpload is used under the covers, you should then read the documentation with "threshold size" as keyword to configure the memory limit for uploaded files. When the file size is beyond the threshold, it would then be written to disk.