Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: 提供内存限制功能 #3593

Closed
Odriver opened this issue Dec 24, 2024 · 3 comments
Closed

[Feature Request]: 提供内存限制功能 #3593

Odriver opened this issue Dec 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Odriver
Copy link

Odriver commented Dec 24, 2024

描述你想要的新功能

有时候代理程序可能占用大量内存导致 OOM kill,从而影响整个系统。希望提供限制程序内存的功能。
已知 trojan-plus 在长期使用后可能内存泄漏导致 oom

描述你想要的解决方案

#!/bin/sh
ulimit -v 1048576  # 设置1GB限制
./your_program

描述你考虑过的替代方案

No response

其他信息

No response

@Odriver Odriver added the enhancement New feature or request label Dec 24, 2024
@BGzEroll
Copy link

passwall只是一个脚本,用于启动各个组件。对于内存泄漏,你应该去对应组件的仓库提issue。

@wtfr-dot
Copy link

在/etc/sysctl.d目录里自定义一个conf,如98-network-custom.conf,在里面加入下面两行试试
vm.overcommit_memory = 2
vm.overcommit_ratio = 90

@lwb1978 lwb1978 closed this as completed Jan 1, 2025
@1115919577
Copy link

Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.757401] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.757583] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.766996] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.773955] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.783600] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.791819] __vm_enough_memory: pid: 11126, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.800402] __vm_enough_memory: pid: 11294, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.807562] __vm_enough_memory: pid: 11294, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.816140] __vm_enough_memory: pid: 11294, comm: xray, not enough memory for the allocation
Mon Jan 13 02:08:54 2025 kern.warn kernel: [142977.824504] __vm_enough_memory: pid: 11294, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.162510] __vm_enough_memory: 30 callbacks suppressed
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.162533] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.167008] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.175498] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.183780] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.192386] __vm_enough_memory: pid: 11124, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.200710] __vm_enough_memory: pid: 11124, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.209212] __vm_enough_memory: pid: 11124, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.217727] __vm_enough_memory: pid: 11124, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.226298] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:49 2025 kern.warn kernel: [143033.234589] __vm_enough_memory: pid: 8148, comm: xray, not enough memory for the allocation
Mon Jan 13 02:09:57 2025 kern.warn kernel: [143041.161751] __vm_enough_memory: 2 callbacks suppressed

这个xray是不是有内存泄漏,运行两天就会这样,内存越用越少

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants