gpt4 book ai didi

apache - "insufficient memory for the Java Runtime"来自 Perl-CGI 通过 apache

转载 作者:太空宇宙 更新时间:2023-11-03 17:21:11 26 4
gpt4 key购买 nike

我正在尝试从 perl-CGI 执行如下 apache drill sql

my $result =  `export _JAVA_OPTIONS="-Xms1024M -Xmx1024M";/opt/mapr/drill/drill-1.6.0/bin/sqlline -u "jdbc:drill:drillbit=172.16.50.16" --showHeader=false --silent  <<EOF
$query
EOF`;

但是当我尝试浏览时出现以下错误:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid16431.log


cat /tmp/hs_err_pid16431.log
#
# There is insufficient memory for the Java Runtime Environment to continue.
# 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
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (os_linux.cpp:2638), pid=16431, tid=0x00007f61fae76700
#
# JRE version: (8.0_101-b13) (build )
# Java VM: OpenJDK 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

--------------- T H R E A D ---------------

Current thread (0x00007f61f4011800): JavaThread "Unknown thread" [_thread_in_vm, id=16467, stack(0x00007f61fad76000,0x00007f61fae77000)]

--------------- P R O C E S S ---------------

知道哪里出了问题吗?或者如何从 perl-CGI 中判断 java 堆内存大小?

甚至两者使用的 java 版本相同(64 位)。

当通过命令行运行时,该命令工作正常。

最佳答案

这是一个 selinux 问题。 Selinux 不允许java 进程执行内存分配命令。检查日志在 /etc/httpd/logs/ssl_error_log

运行下面的命令

sudo semodule -i/usr/share/selinux/targeted/java.pp.bz2

sudo restorecon -r -v/usr

关于apache - "insufficient memory for the Java Runtime"来自 Perl-CGI 通过 apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40082430/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com