-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Core: Fix memory leaks with RequireFeatures() #4095
Conversation
RequireFeatures() must be called at init
需要贴上具体配置吗,客户端入站socks和透明代理fakedns,出站leastload,vless+ws,同配置换到最新版本可以跑起来,换到这个版本就崩了 |
@o0HalfLife0o 是否配置了 observatory 或者 burstObservatory? |
{
"log": {
"loglevel": "debug",
"dnsLog": false,
"access": "/var/log/xray/access.log",
"error": "/var/log/xray/error.log"
},
"inbounds": [
{
"protocol": "dokodemo-door",
"port": 5353,
"tag": "dns-in",
"settings": {
"address": "127.0.0.1",
"network": "udp"
}
},
{
"protocol": "dokodemo-door",
"port": 10800,
"tag": "tproxy-in",
"settings": {
"network": "tcp,udp",
"followRedirect": true
},
"sniffing": {
"enabled": true,
"destOverride": "fakedns",
"metadataOnly": true
},
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
},
{
"port": 10810,
"protocol": "socks",
"tag": "socks-in",
"settings": {
"auth": "noauth",
"userLevel": 0
},
"sniffing": {
"enabled": true,
"destOverride": [
"fakedns+others"
]
}
}
],
"outbounds": [
{
"protocol": "dns",
"tag": "dns-out",
"streamSettings": {
"sockopt": {
"mark": 2
}
}
},
{
"protocol": "freedom",
"tag": "direct",
"streamSettings": {
"sockopt": {
"mark": 2,
"domainStrategy": "UseIP"
}
}
},
{
"protocol": "blackhole",
"tag": "block",
"settings": {
"response": {
"type": "http"
}
}
}
],
"dns": {
"tag": "dns_inbound",
"hosts": {
"dns.pub": "119.29.29.29",
"dns.alidns.com": "223.5.5.5",
"black.qimo.ink": "127.0.0.1",
"geosite:category-ads-all": "127.0.0.1"
},
"servers": [
{
"address": "127.0.0.1",
"port": 55,
"domains": [
"geosite:cn",
"geosite:geolocation-cn"
],
"skipFallback": true
},
{
"address": "127.0.0.1",
"port": 55,
"expectIPs": [
"ext:geoip-only-cn-private.dat:cn"
]
},
{
"address": "fakedns",
"queryStrategy": "UseIPv4"
}
]
},
"fakedns": {
"ipPool": "198.18.0.0/15",
"poolSize": 65535
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"inboundTag": [
"dns-in"
],
"outboundTag": "dns-out"
},
{
"inboundTag": [
"dns_inbound"
],
"outboundTag": "direct"
},
{
"domain": [
"geosite:cn",
"geosite:geolocation-cn"
],
"outboundTag": "direct"
},
{
"ip": [
"ext:geoip-only-cn-private.dat:cn",
"ext:geoip-only-cn-private.dat:private"
],
"outboundTag": "direct"
},
{
"network": "udp",
"port": 443,
"outboundTag": "block"
},
{
"domain": [
"geosite:category-ads-all"
],
"outboundTag": "block"
},
{
"port": "0-65535",
"balancerTag": "balancer"
}
],
"balancers": [
{
"tag": "balancer",
"selector": [
"cft-ws-"
],
"fallbackTag": "backup-cft-ws",
"strategy": {
"type": "leastLoad"
}
}
]
},
"burstObservatory": {
"subjectSelector": [
"cft-ws-"
],
"pingConfig": {
"destination": "https://www.gstatic.com/generate_204",
"interval": "5m",
"connectivity": "http://connectivitycheck.platform.hicloud.com/generate_204",
"timeout": "30s",
"sampling": 3
}
},
"policy": {
"levels": {
"0": {
"uplinkOnly": 0,
"downlinkOnly": 0
}
}
}
} burstObservatory |
@o0HalfLife0o 麻烦再试一下 https://github.com/XTLS/Xray-core/actions/runs/12150035104 应该不会崩溃 主要要看下 leastload 有没有起作用 |
不生效,空返回,一直回落到备用节点 |
好吧 我回头再改下 |
发现是 *ray 的一个老问题:一直以来 DI 的模块必须遵循一个启动顺序 router 模块启动的时候还没有 observer 所以失败了 现在加了一个 Async DI 以后可以不需要关注启动顺序了 274bbc7 |
看日志似乎没有什么变化,依然还是启动就全部测试失败,回落到备用,等了7分钟,1个测试周期都过去了依然回落到备用 |
@o0HalfLife0o 你确定用了这个 https://github.com/XTLS/Xray-core/actions/runs/12226583682 ? |
This reverts commit c9a1ea1.
刚刚重新下载对比了下版本号,没有错的
|
error-xh.log |
@o0HalfLife0o 感谢测试!应该没问题了 |
error.log |
It is said these log help resolve an issue #4095
感觉哪里不对但是你说有 log 可以就先加上吧。。 |
This reverts commit ce241cb.
https://github.com/XTLS/Xray-core/actions/runs/12260440947 |
我也注意到了 原来问题是 ray 的 injection 速度超过我想象的慢 ;) |
最新 https://github.com/XTLS/Xray-core/actions/runs/12260640616 目前看是没问题了,我放在路由器n1上测试的,性能可能比不上最新的路由器芯片,但是应该不会太糟糕 |
yeah I guessed you must be using a router device. That's good as we need to make sure it works in all kinds of environment. Thanks again! |
#3338 这个问题也被修复了吗 |
有可能 需要原po测试 |
@yuhan6665 看下这个 #4149 ,快的话我们能发一版 v24.12.11 |
Thanks a lot! |
@yuhan6665 @RPRX 这个pr在freebsd amd64上启动失败,提示
我刚刚本来是在服务端更新最新commit结果遇到这个问题,于是一个个commit回退测试出来的 |
感谢报告 重开一个issue 发完整日志我看一下 |
|
RequireFeatures() must be called at init.
It should fix memory leak at balancers, observatory and fakedns. Need some testing to confirm it is working as expected.