Main Site Documentation

Lots of Garbage collecting


#1

Im making an application and trying to create OTA (over the air update or infield update) to do this, i use the cellular radio module to create a (passive) FTP connection and receive the HEX file from the server (about 650kb). As soon as i open the passive connection, the carbage collector kicks in and thats running for about 2-3minutes. This results in a broken connection by the FTP after some time and no response from the debugger what so ever. After the GC is done, i only got about 25kb data.

Why is the GC running for 2-3minutes (and doing so every 10seconds or something…). And how can i fix this :frowning:


#2

Hi,
is your device a FTP Server or Client?
Which implementation do you use for this?
Do you create any large buffer to store the hex file in?
Could you provide some code sample where you download the file via FTP?


#3

Post some code.

I’ll bet you’re concatenating a string in the input.


#4

How can GC run for 2-3 minutes every 10 seconds?

At the top of each CG output is an execution time. What does it say?


#5

In general, to avoide GC to kick in use variables smart and use static variables for everthing you need to reuse.