-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
droidVNC-NG keeps disconnecting after long usage #113
Comments
@rnveach thanks for the report! Most valuable would be logs from the server side, so if you could arrange for a logcat-capturing setup, that'd be awesome! |
@bk138 This is not a rooted android device and I am not really an android developer. Won't logcat technically not work because of Google's separations of apps type permissions? Do I need to do anything special to do this? |
You can do that with any device, it's a bit of setup but worth the effort: https://developer.android.com/studio/command-line/adb |
Let me know if this is enough or how to clip out more.
Looking at the logs in some more detail. It looks like I may have kept the app running for a few days, but started using it this morning around 9am. It wasn't until 11:27 then that the out of memory crash occurred. It wasn't until almost less than 2 minutes before the crash did the GC heap messages start appearing. Current memory usage is 36 megs. Maximum reported usage in the last 1 day is 369 megs. |
Thank you very much for the effort! Looks like a memory leak. Can you try it on a different device to rule out the leak is somewhere in the OS implementation? |
I do not have another android device. Last time I tried testing on the example but I couldn't reproduce the previous issue there. I atleast tried testing there with this issue, but after an hour or so, I haven't seen any increased memory usage. How do you want me to test this? |
Honestly, no good idea. It might be this special device, another app on the device or droidvnc-ng itself. The only way I see ruling out the first two is to (long-time) test on another device. |
Let me ask a stupid question as I am not an android developer,
https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L246 I ran against the example server for hours with no change in memory. It at least seems to reason right now, the issue may not be in that piece of code (libvncserver). |
Very nice find! That may well be! One approach to test this out would be trying to run the server without any pointer input. Then it should not leak memory, right? |
Anyway, after thinking about it, https://developer.android.com/reference/android/graphics/Path#close() is probably not the right call as this would connect the path's last point with its first, forming a shape. Definitely not what we want for gesture input ;-) |
@bk138 I wish to try to play with the code on my device, but when I build droidVNC I get an x86 so file (Windows users). How do I match it up with release version, arm64-v8a? I am using Android Studio on my Windows machine. One thing I wanted to check was just closing the path after it is done with for the instance after its passed to the gesture. There is also a |
Sounds like you're building for an emulator, you have to connect your device via USB and it should show up in Android Studio. Then you can simply hit the ▶ icon and the app should launch on the device.
You can try this, though I suspect that |
@bk138 Thanks, I was able to deploy changes and test on my device. First, the following change worked fine and did not close the shape in on itself when sending the strokes to the device. I do have an app called "Multi Touch Test" and it shows where on the screen it is being touched and it never went back in on the start even when I was doing odd shapes.
Unfortunately, this did not fix the OOM exception and it did break today. Not sure if it lasted any longer, sort of seemed like it, but theres no way to tell really.
I haven't really played around with Android Studio, but I am not sure what else to do at this point. |
@rnveach you might want to keep the device running while having https://developer.android.com/studio/profile/memory-profiler attached, that should bring some insights. |
Does droidVNC do anything from normal screen touching outside of the VNC connection? (Java) Memory increase is very small that the graph doesn't really show an increase, but you can see 0.1 meg increases every second or so. It does seem to increase only on input like i was originally going with, but it seems it also increases when touching the screen not through the VNC connection which I found odd unless droidVNC is getting callbacks of this event. There does seems to be a GC that eventually happens and it goes back down. Android Studio crashed when trying to look into 1 hour of data, but from what I could see I think its the point to say that I haven't identified anything more as needing fixing yet, but I am not an android developer. |
You might me seeing allocations when the screen contents change.
You could try a longer run that not has input permission given and see if that changes anything. |
FYI had a crash related to #122: the server restarted, but input was not wired up again. Interesting find. |
Thanks. Just for informational, I am not copying text during the connection and currently have clipboard disabled between the 2 in the VNC client. |
I have the same problem. A synthetic process remotely accesses the device with TightVNC Viewer on the physical device every 5 minutes. After 6 days, the device no longer accepts mouse clicks or keystrokes, but still shows the current screen. Mobile Device: Samsung Galaxy S8 |
Started using droidVNC yesterday and run into the same issue today. |
I am also experiencing this issue running version v1.3.5. |
Same issue here. I see the screen, but inputs are not working. After restarting the service, it's working again. |
🎉 reproducible w/
|
When we are restarted by the OS after a crash, setScaling() is not called, so set scaling from last known setting instead of leaving it at 0. Closes #113
@bk138 This fix will be released as part of 1.3.6 ? Any ideas on a planned release date? |
1.4.0. Next week hopefully. |
When we are restarted by the OS after a crash, setScaling() is not called, so set scaling from last known setting instead of leaving it at 0. Closes #113
@bk138 So far everything has been working good for this issue, thanks. |
@bk138 Out of Memory exceptions have started appearing again with 2.1.3 . I can't confirm if it is just this version, or any of the priors. The only difference in behavior is when I reconnect, I can still use input by clicking on the screen and such, where as before i couldn't click anything. Average memory usage is 227 mb, maximum usage is reported as 323 mb (reported by developer settings). Do you want a new issue for this or re-open this one? Log:
|
It is not like #121 from its top description.
For me, the viewer gets completely disconnected. I did NOT see any lost of frame updates as that issues describes before I am disconnected. At #121 (comment) , they even say they don't see the connection dropping while I am being dropped when the OOM occurs. Also, I didn't capture it exactly at the time, but my phone currently says I have 2.1 GB of memory free (average use is 5.9 out of 8). So I don't really consider this a low memory situation on my device. |
@rnveach you might want to try https://github.com/bk138/droidVNC-NG/releases/tag/v2.1.2 which has a fix for a memory leak (but is prone to crash when stopping the server). If this works, the incomplete fix in there would be the solution to this here issue. |
Describe the bug
VNC clients get booted after staying connected to droidVNC-NG 1.3.5 for a long time. Reconnecting to said device displays the screen, but input does not work. I have to physically turn off droidVNC-NG and turn it back on for things to resume.
To Reproduce
Install droidVNC-NG 1.3.5 from the playstore.
Setup droidVNC-NG and get all permissions granted.
Set a password on droidVNC-NG.
Download tightvnc Java 2.8.3.
Have tightvnc connect to droidVNC-NG.
Use for hours, with medium mouse press uses.
Eventually client gets disconnected.
Expected Behavior
Expected to be able to connect to the device with droidVNC-NG 1.3.5 and stay connected with no perceived timelimit.
Logs/Backtraces
Tightvnc:
Your environment (please complete the following information):
Additional context
The latest failure occurred today after being connected for 3 1/2 hours. I have not really seen a constant time before the issue occurs.
droidVNC-NG still says input has been granted on the main screen.
I have confirmed on RealVNC that the inputs do not work anymore when the issue happens.
I have experienced this issues back on older versions, 1.2.6 I believe.
The text was updated successfully, but these errors were encountered: