Downloading problems

Smee

Well-Known Member
Licensed User
Longtime User
I am downloading some files nd after a few files have downloaded the program pauses at a particular file. If i press F5 or F8 i get the following error.

There is nothing wrong with the file itself


B4X:
internetservice_ftp_listcompleted (B4A line: 114)
FTP.DownloadFile(ServerPath & "/" & Files(i).Name, False, File.DirInternal & "/cats" & DlFolderName & "/", Files(i).Name)
java.util.concurrent.RejectedExecutionException
   at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1876)
   at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:774)
   at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1295)
   at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:33)
   at anywheresoftware.b4a.B4AThreadPool.submit(B4AThreadPool.java:39)
   at anywheresoftware.b4a.BA.submitRunnable(BA.java:232)
   at anywheresoftware.b4a.ftp.FTPWrapper.DownloadFile(FTPWrapper.java:122)
   at WDROrder.Program.internetservice._ftp_listcompleted(internetservice.java:407)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
   at anywheresoftware.b4a.BA$1.run(BA.java:210)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:4627)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
   at dalvik.system.NativeStart.main(Native Method)

I just looked at the unfiltered log and this is shown before the above

B4X:
GC_FOR_MALLOC freed 12797 objects / 401848 bytes in 20ms
Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 29198 objects / 544936 bytes in 22ms
GC_FOR_MALLOC freed 32233 objects / 526528 bytes in 21ms
GC_FOR_MALLOC freed 32033 objects / 518576 bytes in 30ms
GC_FOR_MALLOC freed 31790 objects / 515160 bytes in 21ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 31503 objects / 524000 bytes in 21ms
GC_FOR_MALLOC freed 31937 objects / 518544 bytes in 21ms
GC_FOR_MALLOC freed 31327 objects / 522552 bytes in 21ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 31378 objects / 511872 bytes in 21ms
GC_FOR_MALLOC freed 31933 objects / 517632 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
ACTION_BATTERY_CHANGED pluggedType: 1
GC_FOR_MALLOC freed 31038 objects / 517632 bytes in 29ms
GC_FOR_MALLOC freed 31458 objects / 511976 bytes in 23ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30833 objects / 514360 bytes in 22ms
GC_FOR_MALLOC freed 30725 objects / 501544 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30869 objects / 516040 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30184 objects / 506344 bytes in 22ms
GC_FOR_MALLOC freed 30795 objects / 514152 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30489 objects / 499488 bytes in 23ms
GC_FOR_MALLOC freed 31339 objects / 520800 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30485 objects / 499488 bytes in 22ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 29773 objects / 501648 bytes in 23ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 28698 objects / 487040 bytes in 23ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
GC_FOR_MALLOC freed 30174 objects / 507320 bytes in 23ms
Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
ACTION_BATTERY_CHANGED pluggedType: 1
GC_FOR_MALLOC freed 30443 objects / 532112 bytes in 23ms

Is this an out of memory error? How can i correct it if it is
 

Smee

Well-Known Member
Licensed User
Longtime User
Thank you

I will read up on that

EDIT:

That may not be appropriate for my task. I need to log on to the internet server and i also need to show a progress bar. I could not see how to implement that without knowing the file size and the state of the download as i can with the

FTP_DownloadProgress Sub.

Is there a way i can check how many files are in the q at any one time using the ftp library?

Thanks
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…