Memory grows and grows

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Memory grows and grows

Post by ace16vitamine » Tue Jul 10, 2018 6:59 am

Hi,

I have a small script and I have no Idea what is going on wrong. After 24h the application is frozen, I monitored the task manager and identified that the memory usage is growing and growing.

The script is something like a HUB. It received datas from other Applications (over socket) every minute and deploy this informations to mobile client applications (also with socket). But every minute the mem usage is growing for 200-800k...

Example, every minute a server is contacting the hub and transfer informations:
accept connections on port 9999 with message "verbindung_client_read"
...
...
get the informations from server...
write it to sqlite DB
...
---
write the informations to mobile client
1) My first Idea was that there is a growing Variable. I startet to clean up all Variables every time but it does not help.

2) I checked every loop, case etc , but the script is clean

3) DBCons are open, closed etc. No issue here. Same with Sockets. After the communication the socket is closed.

Any Ideas how to clean up the memory?

Thanks
Stefan

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Memory grows and grows

Post by FourthWorld » Tue Jul 10, 2018 8:12 am

How did you check the number of open sockets?

And do you use any timers?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Memory grows and grows

Post by ace16vitamine » Tue Jul 10, 2018 9:13 am

I am not using timers (this was also my first Idea).

To check the open sockets I am using

the opensockets (..) in the message box, but all sockets are closes successful. What I find out: I have the same issue if a client connects to collect datas, the socket can be the problem.

Every time the Client or Server is opening a connection to the hub the RAM usage is growing on the HUB

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Memory grows and grows

Post by FourthWorld » Tue Jul 10, 2018 4:21 pm

Which LC version?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Memory grows and grows

Post by ace16vitamine » Tue Jul 10, 2018 4:24 pm

9.0.0 Build 15017

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Memory grows and grows

Post by ace16vitamine » Tue Jul 10, 2018 8:42 pm

same issue with LC 9.0.1 RC1

Poll is every minute. After 8h the mem usage is now 1GB :shock:

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Memory grows and grows

Post by dunbarx » Tue Jul 10, 2018 10:03 pm

This seems rather high. I would post the stack to QCC.

Craig

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Memory grows and grows

Post by ace16vitamine » Tue Jul 10, 2018 11:29 pm

hm... Now it is funny: With 9.0.1 RC1... The process startet growing but it seems that it is stable now. Let me check it tomorrow morning.

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Memory grows and grows

Post by ace16vitamine » Wed Jul 11, 2018 7:28 am

I can confirm that it is not growing with LC 9.0.1 RC1 Win. I can see some smaller thinks but thats normal, for me it looks like stable now.

Thank you for your help.

Stefan

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”