好的,这里有两个问题,为什么我的磁盘交换被使用?我的交换的压缩真的这么好吗?这似乎不太可能,但也有可能是因为应用程序(如JVM)保留了内存,但实际上并没有使用。
Linux manjaro 5.10.59-1-MANJARO #1 SMP PREEMPT Sun Aug 15 13:11:32 UTC 2021 x86_64 GNU/Linux
这是我的初步测量
❯ swapon
NAME TYPE SIZE USED PRIO
/dev/nvme0n1p6 partition 32.2G 2.4G -2
/dev/zram0 partition
我已经开始面临本机内存分配问题了。我猜可能与-Xmx和-Xms设置有关。设置此值的推荐方法是什么?
目前我有:-Xmx13G -Xms6G
我读到建议设置相同的值,但没有解释为什么。
我得到的错误是:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 746061824 bytes for committing reserved memory.
# Possible reasons:
#
我正在运行一个linux发行版,并且正在摆脱内存异常。
>java -version
#Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000646e00000, 264241152, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory
我是从dmesg来的
Out of memory: Killed process 24502 (python) total-vm:19568804kB, anon-rss:14542148kB, file-rss:4kB, shmem-rss:0kB, UID:1000 pgtables:31232kB oom_score_adj:0
我怎样才能增加内存的大小而不是买一个新的内存呢?
我有(free):
total used free shared buff/cache available
Mem: 1