-1
I tried to import a 66 megas file, and gave this error in wildfly : Caused by: java.lang.Outofmemoryerror: Java heap space
In addition to including this setting in spring.
@Bean public Multipartresolver multipartResolver() { Commonsmultipartresolver multipartResolver = new Commonsmultipartresolver(); multipartResolver.setMaxUploadSizePerFile(524288000); multipartResolver.setMaxUploadSize(524288070); multipartResolver.setDefaultEncoding("UTF-8"); Return multipartResolver; }
I modified the file size on the server, according to image:
Understand that the server has little memory.
I went to the archive standalone.conf, of the server and modified:
JAVA_OPTS="-Xms64m -Xmx512m -XX:Maxpermsize=256m -Djava.net.preferIPv4Stack=true" JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
for:
JAVA_OPTS="-Xms1024m -Xmx2056m -XX:Maxpermsize=2056m -Djava.net.preferIPv4Stack=true" JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
Still I still have the same mistake ?
What can it be ?
Server image.
Check the top menu on
Runtime
, and then on the side menu on the leftJVM
add Heap information here too (Used and Committed)– Paulo H. Hartmann
Thanks @Pauloh.Hartmann, I added to the question what you asked for.
– Guilherme
This strange, sure you use the settings of standalone server? (it may be that your server is picking up the settings from standalone-full for example) If I’m not mistaken the memory described in the Committed Heap field should be what is described in the -Xms configuration of the . conf file
– Paulo H. Hartmann
More or less. Where is this file ? How do I change ?
– Guilherme
How are you starting the Wildfly server? Are you starting it through an IDE, like netbeans? or are you going in the shell and going up there?
– Paulo H. Hartmann
I’m starting with the eclipse.
– Guilherme