PHPJasper / phpjasper

A PHP report generator
MIT License
468 stars 162 forks source link

Command Successful, but the Laravel Website causing JAVA Out of Memory Error #316

Closed johnwswar closed 2 years ago

johnwswar commented 2 years ago

I can use the command line to both compile and process document to rtf and pdf in Linux environment. However, when I try to run this inside a Laravel Controller, I get the following message: Your report has an error and couldn 't be processed!\ Try to output the command using the function output(); and run it manually in the console."_

However, there is an error log in the jasperstart/bin directory which states the following:
There is insufficient memory for the Java Runtime Environment to continue.

Spent a great deal of time trying to resolve this issue. Would greatly appreciate it, if one can point me to a solution.

Centos 7:
Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory. Possible reasons: The system is out of physical RAM or swap space The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap Possible solutions: Reduce memory load on the system Increase physical memory or swap space Check if swap backing store is full Decrease Java heap size (-Xmx/-Xms) Decrease number of Java threads Decrease Java thread stack sizes (-Xss) Set larger code cache with -XX:ReservedCodeCacheSize= JVM is running with Unscaled Compressed Oops mode in which the Java heap is placed in the first 4GB address space. The Java Heap base address is the maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress to set the Java Heap base and to place the Java Heap above 4GB virtual address. This output file may be truncated or incomplete. Out of Memory Error (os_linux.cpp:2795), pid=5910, tid=0x00007fd89bf0b700 JRE version: (8.0_302-b08) (build ) Java VM: OpenJDK 64-Bit Server VM (25.302-b08 mixed mode linux-amd64 compressed oops) Failed to write core dump. Core dumps have been disa

johnwswar commented 2 years ago

Issues was resolved by running the following command in Linux: It caused by apache has no access to use memory

setsebool -P httpd_execmem 1