Вопрос Краш сервера

qasd12

Заблокирован
Сообщения
55
Решения
3
Крашит сервер.
Код:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 16384 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 Zero Based Compressed Oops mode in which the Java heap is
#     placed in the first 32GB 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 32GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2776), pid=10831, tid=19172
#
# JRE version: Java(TM) SE Runtime Environment (16.0.2+7) (build 16.0.2+7-67)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0.2+7-67, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# No core dump will be written. 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 (0x00007f4c4b5da940):  JavaThread "Thread-731" [_thread_new, id=19172, stack(0x00007f4c13618000,0x00007f4c13719000)]

Stack: [0x00007f4c13618000,0x00007f4c13719000],  sp=0x00007f4c13717a30,  free space=1022k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xdfdfa1]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x1a1
V  [libjvm.so+0xdfeb5d]  VMError::report_and_die(Thread*, char const*, int, unsigned long, VMErrorType, char const*, __va_list_tag*)+0x2d
V  [libjvm.so+0x5d8553]  report_vm_out_of_memory(char const*, int, unsigned long, VMErrorType, char const*, ...)+0xc3
V  [libjvm.so+0xbd4128]  os::pd_commit_memory(char*, unsigned long, bool)+0xd8
V  [libjvm.so+0xbccfcf]  os::commit_memory(char*, unsigned long, bool)+0x1f
V  [libjvm.so+0xcbaff7]  StackOverflow::create_stack_guard_pages()+0x57
V  [libjvm.so+0xd7c623]  JavaThread::run()+0x23
V  [libjvm.so+0xd812bd]  Thread::call_run()+0xfd
V  [libjvm.so+0xbd81b7]  thread_native_entry(Thread*)+0xe7

Серверу выделено 7гб ОЗУ из 8. Что делать?
 
Крашит сервер.
Код:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 16384 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 Zero Based Compressed Oops mode in which the Java heap is
#     placed in the first 32GB 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 32GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2776), pid=10831, tid=19172
#
# JRE version: Java(TM) SE Runtime Environment (16.0.2+7) (build 16.0.2+7-67)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0.2+7-67, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# No core dump will be written. 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 (0x00007f4c4b5da940):  JavaThread "Thread-731" [_thread_new, id=19172, stack(0x00007f4c13618000,0x00007f4c13719000)]

Stack: [0x00007f4c13618000,0x00007f4c13719000],  sp=0x00007f4c13717a30,  free space=1022k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xdfdfa1]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x1a1
V  [libjvm.so+0xdfeb5d]  VMError::report_and_die(Thread*, char const*, int, unsigned long, VMErrorType, char const*, __va_list_tag*)+0x2d
V  [libjvm.so+0x5d8553]  report_vm_out_of_memory(char const*, int, unsigned long, VMErrorType, char const*, ...)+0xc3
V  [libjvm.so+0xbd4128]  os::pd_commit_memory(char*, unsigned long, bool)+0xd8
V  [libjvm.so+0xbccfcf]  os::commit_memory(char*, unsigned long, bool)+0x1f
V  [libjvm.so+0xcbaff7]  StackOverflow::create_stack_guard_pages()+0x57
V  [libjvm.so+0xd7c623]  JavaThread::run()+0x23
V  [libjvm.so+0xd812bd]  Thread::call_run()+0xfd
V  [libjvm.so+0xbd81b7]  thread_native_entry(Thread*)+0xe7

Серверу выделено 7гб ОЗУ из 8. Что делать?
Памяти не хватило что тут сказать

Можешь скрипт запуска показать?
 
Памяти не хватило что тут сказать

Можешь скрипт запуска показать?
Код:
#!/bin/sh

# Все системные пути и названия файлов чувствительны к регистру (заглавные и строчные буквы)

# Параметры приложения-сервера

server_name="surv" # Для создания скрина и идентификации процесса в top, htop и т.д.
join_screen=true # Входить ли в скрин автоматически после запуска скрипта
jar_file="server.jar" # Название файла ядра
min_memory="2G" # Минимальное количество памяти
max_memory="6G" # Максимальное количество памяти
server_port="" # Порт. Если не указан - используется значение из server.properties
force_chunks_upgrade=false # Использовать ли при запуске принудительное обновление всех чанков до формата текущей версии ядра

# Параметры Java

profiling=false # Включить ли профилирование (требуется больше системных ресурсов). Работает только с JDK
fix_java_12_issues=false # Предотвращать ли ошибки, связанные с использованием Java 12+
debugging_port="" # Порт агента отладки. Если не указан - отладка отключена
log4j_config="" # Файл параметров log4j с расширением .xml. Если не указано - используются настройки по-умолчанию



# Всё, что ниже, менять не рекомендуется

# Источник: https://mcflags.emc.gs
aikar_jvm_flags="-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true"
jvm_flags="-server -Dfile.encoding=UTF-8"
app_flags="nogui"
screen_name="${server_name}"
htop_name="${server_name}"
script_name=`basename "$0"`
#!/bin/bash

[ "$java_dir" != "" ] && java_dir="${java_dir}/"

jvm_flags="${jvm_flags} ${aikar_jvm_flags}"
if [ "$profiling" = true ]; then
    htop_name="${htop_name}-profiling"
    jvm_flags="${jvm_flags// -XX:+PerfDisableSharedMem/}"
    jvm_flags="${jvm_flags} -Xshare:off"
fi
htop_name="$USER.${htop_name}"

[ "$fix_java_12_issues" = true ] && jvm_flags="${jvm_flags} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED"
[ "$debugging_port" != "" ] && jvm_flags="${jvm_flags} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:${debugging_port}"
[ "$log4j_config" != "" ] && jvm_flags="${jvm_flags} -Dlog4j.configurationFile=${log4j_config}"

[ "$server_port" != "" ] && app_flags="${app_flags} -port ${server_port}"
[ "$force_chunks_upgrade" = true ] && app_flags="${app_flags} --forceUpgrade"

jvm_flags="-D_server=${htop_name} -Xms${min_memory} -Xmx${max_memory} ${jvm_flags}"

while true
do
    eval ${java_dir}java ${jvm_flags} -jar ${jar_file} ${app_flags}
    echo "Server $screen_name stopped. Rebooting in:"
    for i in {3..1}
    do
        echo "$i..."
        sleep 1
    done
done
 
Назад
Сверху Снизу