Jigsaw-Code / outline-go-tun2socks

Apache License 2.0
227 stars 94 forks source link

IOS with v2ray , killed by memory limit #32

Closed excellentconnect closed 3 years ago

excellentconnect commented 4 years ago

V2ray:4.20 go-tun2socks: lastest version

excellentconnect commented 4 years ago

IOS 11 works well.

IOS12 And IOS 13 both can reproduce simply.

alalamav commented 4 years ago

Hi @excellentconnect, we are aware of the iOS memory limits, which is why we set the garbage collector to a one minute interval and set the GC percentage to 10. Our team uses this framework on Outline, which relies on Shadowsocks. We have observed some crashes due to hitting the memory limit, but it's not 100% reproducible. Perhaps you can optimize the vray implementation?

giftedunicorn commented 4 years ago

@alalamav Is it possible to make GO GC even more aggressive? Like calling freeOfMemory every 30 seconds or 10 seconds?

bemasc commented 4 years ago

It's possible, but (if everything is working correctly) it can't save more than 10% of memory.

If you're interested in improving memory usage, a good first step would be to write out a memory profile and identify what is taking up the most space.

IT85626508 commented 4 years ago

The server needs to verify the user information, how to pass the user information to the server when using Tun2socks.framework?

fortuna commented 3 years ago

Since this bug was filed we made a number of memory improvements. Please reopen with fresh information if it's still an issue.