-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
[BUG] 20% CPU overhead in kindness mode #1183
Comments
Snowflake Proxy mode may not be getting turned off properly |
Profiling memory and CPU usage confirms this: The spike in CPU usage, is when I turn Kindness mode on. Then I turned it off. Then I took the screenshot. No downward curve to be witnessed. However, the code looks totally unsuspicious. I debugged it, public synchronized void disableSnowflakeProxy() {
if (mSnowflakeProxy != null) {
mSnowflakeProxy.stop();
logNotice(getString(R.string.log_notice_snowflake_proxy_disabled));
if (Prefs.showSnowflakeProxyMessage()) {
var message = getString(R.string.log_notice_snowflake_proxy_disabled);
new Handler(getMainLooper()).post(() -> Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show());
}
mSnowflakeProxy = null;
}
} Actually a little too often for my tastes... I witnessed WiFi changes which didn't really happen - the device seemed connected continuously, but Snowflake Proxy was turned off and on again. Anyway, a logic bug in Orbot itself seems out of the question. But, IPtProxy looks good, too: // Stop - Stop the Snowflake proxy.
func (sp *SnowflakeProxy) Stop() {
if sp.isRunning {
sp.proxy.Stop()
sp.proxy.EventDispatcher.RemoveSnowflakeEventListener(sp)
sp.isRunning = false
sp.proxy = nil
}
} And the Snowflake code, just as well: for ; true; <-ticker.C {
select {
case <-sf.shutdown:
return nil
default:
tokens.get()
sessionID := genSessionID()
sf.runSession(sessionID)
}
}
return nil
}
// Stop closes all existing connections and shuts down the Snowflake.
func (sf *SnowflakeProxy) Stop() {
close(sf.shutdown)
} So… I'm at a loss, here. @cohosh, sorry that I have to summon you once again… Do you have any ideas? |
How about this: |
Hmm, I'll poke around a bit. I wonder if there is a race condition with the shutdown channel getting closed, and the proxy also waiting for a new snowflake. |
I seem to remember seeing the 20% once when I hadn't turned on the Kindness mode yet. But it usually turns on when the mode is turned on. |
@Android-PowerUser what version of orbot are you using? |
Version 17.3.2-RC-1-tor-0.4.8.12 |
As soon as the kindness mode is on, Orbox starts a process that uses about 20% of the CPU and cannot be turned off. Not even if the mode is turned off. I don't think that's intended. It helps to end the process or the app.
Xiaomi POCO X3 pro
The text was updated successfully, but these errors were encountered: