hectorqin / hectorqin/reader

[server]:有充足内存的情况下报错OutOfMemoryError

Open
#486 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
11k
Forks
5.5k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug 描述你遇到的问题
有充足内存的情况下报错OutOfMemoryError ,类似于 #429 ,但明确并非真的发生了内存不足

To Reproduce 如何重现问题
Steps to reproduce the behavior: 把你遇到的问题的发生步骤替换掉下面的内容:

  1. 使用docker运行reader,并限制内存为2G
  2. 对内存占用进行监测
  3. 使用10并发进行书源检测
  4. 大量请求无返回,达到超时请求后失败;查看日志发现大量报错OutOfMemoryError,但此时仍有充足内存供使用。
    log如:Exception in thread "DefaultDispatcher-worker-xx" java.lang.OutOfMemoryError: Java heap space

Expected behavior 期待修复的效果
在用完或接近用完时再报错OutOfMemoryError,方案为增加自定义堆内存大小,如允许在JVM启动时指定参数且不会被脚本覆盖
-Xmx2048m,如在下面这行就会和手动设置的内存数冲突。

https://github.com/hectorqin/reader/blob/b3f580f49385376b88f92818b5a9dfa874e1f80f/server/bin/startup.sh#L96

Screenshots 如有必要,可以截图说明
容器内存情况
image
宿主机内存情况
image
日志
image

版本说明

  • OS: Ubuntu 22.04
  • Deploy Method: Docker
  • Program Version: v3.2.7-01010833
  • Browser: Google Chrome v120

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with server/bin/startup.sh at line 96 and inspect how the JVM heap size is selected when the reader runs in Docker with a 2G memory limit. Reproduce with 10 concurrent source checks and compare the configured heap with the container's available memory. Done means a user-provided -Xmx2048m setting is accepted without being overwritten and the reported behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, shell
Domain
backend, devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.