funlw65, my app has 19K lines of code, compiles under GTK2 or Qt5 (and Win, Mac) and has no memory leaks or crashes. But let me tell you, it has, during development, had lots and lots of both. And from memory, I can trace just one memory leak to Lazarus, and that was in Mac's Cocoa Carbon (who cares?) and one crash that related to pasting content from the clipboard (that has been fixed). And the rest where mine and mine alone !
Its quite easy to miss things that leak, I found it necessary to continuously check for leaks as I developed. For example, findfirst (used to search directories for files) uses a small data structure that gets auto created for you, you may well claim you did not create it but you must free it !
That being said, my application obviously does quite different things than yours and uses different parts of Lazarus. So, you could be using unstable Lazarus stuff and I am not. Looks (from images in this thread) you are talking to an ardiuno and maybe something else ? So, USB/Serial protocols ? Can be quite timing sensitive.
When it crashes and you are doing nothing, is the app itself also doing nothing ? Or is it hitting that USB interface watching for something to change ? Is that something you can disable to see if the situation improves ?
Davo
Edit, replaced the work Cocoa with Carbon, sorry about stupid mistake.