S
S
Slavka2016-06-01 16:08:19
Qt
Slavka, 2016-06-01 16:08:19

How to write applications 24/7?

I wrote an application that will constantly run on a PC and collect data from sensors, displaying it in the form of graphs. I left the application to work for a couple of days with one sensor (then it will be about 40), as a result, the application interface starts to slow down, what could be the reason for this? I write all the data in a heap

Answer the question

In order to leave comments, you need to log in

7 answer(s)
G
GavriKos, 2016-06-01
@GavriKos

Usually this is due to a crookedly written application.
First - the interface separately - monitoring separately. The interface can be closed - the monitoring daemon / service will remain
Secondly - where is the data written? In the operative? How much has the app consumed? What data structures did you use? Have you tried writing to the database?

E
Evgeny Akhmetov, 2016-06-01
@asperin2

It's hard to say so, but most likely https://ru.wikipedia.org/wiki/%D0%A3%D1%82%D0%B5%D...

G
Gizmothron, 2016-06-01
@Gizmothron

We divide the application into parts. To isolate the removal of information from sensors and analysis-display into separate programs.
Before them, we launch the most primitive proxy balancer, which works stably, because it is simple.
We monitor applications behind a proxy.
As soon as something suspicious, restart.
At the time of restart, the balancing proxy sends sensors to the second (backup) application instance.
This was originally designed for continuous "green-blue deploy", but can be used for stabilization as well.
Another option:
Debug the application properly.

M
mamkaololosha, 2016-06-01
@mamkaololosha

1) Write the data to the file
2) In the RAM, keep only those relevant for the chart

X
xmoonlight, 2016-06-01
@xmoonlight

It's simple: get the data 1000000 times => put it ONCE and clear the memory for a new portion!
You exit the application - throw off what is on the disk and close it.

D
dron100, 2016-06-01
@dron100

crooked application, the RAM is small and it is not cleared.
For a while, this could be seen in Google Chrome .. when you wean the tabs, you close it and the memory consumption only increases and, as a result, a crash followed by a reboot.
Open the resource monitor and see.

Y
yurchik25, 2016-06-02
@yurchik25

you need to watch the resource monitor, but most likely the application is written a little crookedly. It is necessary to track the entry in the database (if it is written there) and track which part of the application eats the most resources and try to optimize it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question