Android Question too many files open?

Andreas_D99

Member
Licensed User
With this Code-Line I check the Wifi-Connection to the Server:
B4X:
p.Shell("ping -c 1 " & strServerIP,Null,sb,ErrMess)
at irregular intervals the App crashes at this Line with the Message "too many Files open"... although the app has not been used for a long time and no other files are open on the device. Does anyone know ...?

Device is a HTC One M8 with Android 6.0. Probably is a Device-Problem. I test also on a realy slowly and small Huwai Ascend, but the above Error there is much less...
 

Andreas_D99

Member
Licensed User
really fast today... :)

I run the ping every 10 seconds via the starter service

B4X:
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Main
lngNr: 12930
SH43RWM10192
** Activity (main) Resume **
Main IP: 192.168.0.2
Raising.. mysql_status
Connected to Database
MySQL_Status(true,false,0)
Connected = true
---- AppUpdating.ReadCurVN
            Current Version: 2.08
UpdateComplete - time: 12:35:54
---- AppUpdating.ReadWebVN
** Service (starter) Start **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
10/02/2018, 10/16/2018
targetDate: 1539640800000, Current: 1538431200000, timeToDate: [Days=14, Hours=0, IsInitialized=true
, Minutes=0, Months=0, Seconds=0
, Years=0], DaysLeft: 14
(MyMap) {ms=3, TaskID=}
---- AppUpdating.JobDone --
UpdateComplete - time: 12:35:58
(MyMap) {ms=13, TaskID=}
(MyMap) {ms=9, TaskID=SetOnline}
(MyMap) {ms=3, TaskID=SetOnline}
strLoginDate: 10/02/2018
(MyMap) {ms=5, TaskID=SetLogin}
(MyMap) {ms=7, TaskID=Del_Storno}
(MyMap) {ms=4, TaskID=Del_Split}
(MyMap) {ms=5, TaskID=Start_Window}
(MyMap) {ms=5, TaskID=Set_LogCode}
** Activity (main) Pause, UserClosed = false **
** Activity (tische) Create, isFirst = true **
** Activity (tische) Resume **
Tische IP: 192.168.0.2
PING 192.168.0.51 (192.168.0.51) 56(84) bytes of data.
64 bytes from 192.168.0.51: icmp_seq=1 ttl=128 time=2.59 ms
--- 192.168.0.51 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.592/2.592/2.592/0.000 ms
(MyMap) {ms=15, TaskID=}
Raum3: Restaurant
** Activity (tische) Pause, UserClosed = false **
Error occurred on line: 46 (Starter)
java.io.IOException: Error running exec(). Command: [ping, -c, 1, 192.168.0.51] Working Directory: null Environment: null
            at java.lang.ProcessManager.exec(ProcessManager.java:215)
            at java.lang.Runtime.exec(Runtime.java:174)
            at java.lang.Runtime.exec(Runtime.java:247)
            at java.lang.Runtime.exec(Runtime.java:190)
            at anywheresoftware.b4a.phone.Phone.Shell(Phone.java:91)
            at Gastro.Mobile.starter._timer2_tick(starter.java:327)
            at java.lang.reflect.Method.invoke(Native Method)
            at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
            at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
            at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
            at java.lang.reflect.Method.invoke(Native Method)
            at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
            at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:168)
            at android.app.ActivityThread.main(ActivityThread.java:5845)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Caused by: java.io.IOException: Too many open files
            at java.lang.ProcessManager.exec(Native Method)
            at java.lang.ProcessManager.exec(ProcessManager.java:213)
            ... 19 more
 
Upvote 0
Top