Page 1 of 3

CMXv4 Memory usage

Posted: Thu 04 Apr 2024 9:13 am
by Dador
Build 4019 fixed the problem with charts. Thanks.

Currently, CMXv4 generally works well, except for one thing. I still have huge RAM usage.
Immediately after launch, it consumes about 110 MB. When I update the website (charts), it increases to over 450 MB and does not drop. For comparison, below is the RAM consumption of CMXv3, barely 20 MB :D .

I'll wait for .NET8.0.4. Maybe something will help, maybe not.

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 9:39 am
by SamiS
I haven’t run CMX in windows, but on Raspberry latest v3 b3283 starts at about 150MB and due to an unresolved memory leak on some setups it grows up to nearly 2GB in a month on my setup. So in my eyes 450MB is not even worth worrying about if it does not grow constantly.

I wonder if the difference is somehow related to how Windows calculates the actual process size vs the linked runtime libraries. Maybe the old net framework 4.8 is ”part of operating system” and not shown, but dotnet 8 is handled differently. Dunno. :? Of course it would be interesting to know if other users are seeing the same.

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 9:44 am
by mcrossley
Yep, memory usage has ballooned. I *think* there may be an improvement coming in 8.0.5, but meantime I am investigating other ways of limiting it....

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 9:46 am
by broadstairs
I have two copies of CMX running on Linux and each have about 220Mb memory plus some shared memory so two copies running about 440Mb non-shared memory. My system has 15Gb memory though so not an issue, whole system uses about 1.6Gb of the 15Gb. I'm not sure I've seen any increases over time which are significant. Sounds like Windows has an issue with .NET which does not affect Linux.

Stuart

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 10:06 am
by Dador
SamiS wrote: Thu 04 Apr 2024 9:39 am I haven’t run CMX in windows, but on Raspberry latest v3 b3283 starts at about 150MB and due to an unresolved memory leak on some setups it grows up to nearly 2GB in a month on my setup. So in my eyes 450MB is not even worth worrying about if it does not grow constantly.
WOW :shock:

Currently my 2 CMXv3 installations use about 20MB RAM each. I'm used to them running in the 20-40MB range. So both of them do not use more than 100MB together. For me, this 450MB is a shock.

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 1:05 pm
by mcrossley
I do have it under a bit of control now, but it is an ongoing investigation.

On Windows it is now consuming around 105 MB (125 for the debug version) at the start, which does increase like v3 when you view charts etc. But there is also evidence that the garbage collector is having some effect. After running for two and half hours the memory usage was 178 MB. Previously it went up to 250 MB very quickly.

NOTE: Windows Task Manager uses a different memory usage value. It uses the private portion of the working set. When MX was using 105 MB by my figures, Task Manager showed it as using 70 MB, and 178 MB = 108 MB in TM.

Please try replacing the attached file and restart your v4 and see what effect it has over a day or so....

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 2:12 pm
by PaulMy
I don't seem to have any memory issues and all seems fine. I don't have extra sensors other than AirLink.
I have 5 CMX running at the moment... attached Windows Task Manager 1st and 2nd CumulusMX are v4-b4019 and run consistently under 60 Mb with one connected with local WLL and the other Davis WL Cloud, and the others are v3-b3283 with the 3rd connected with WiFiLogger, 4th with Davis Cloud VP2, and the 5th with local WLL. Is there another way I should check this?

Enjoy,
Paul

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 2:21 pm
by mcrossley
Those are much lower figures than I am seeing Paul - I have no idea why that would be but count yourself lucky!

Re: CMXv4 ExtraSensors Trends

Posted: Thu 04 Apr 2024 2:50 pm
by Dador
I haven't tried using CMXv4 with Davis yet, but I suspect I may have the same as Paul, which is low RAM consumption.
I observed how CMXv4 behaves with Ecowitt. Right after starting, the consumption reaches about 50MB, but once Cumulus connects to the station, it suddenly jumps to about 110MB, and then slowly increases. Perhaps this is where the problem lies, i.e. the CMX + Ecowitt gateway connection. But these are just random thoughts. This would need to be monitored more closely.

EDIT:
mcrossley wrote: Thu 04 Apr 2024 1:05 pm Please try replacing the attached file and restart your v4 and see what effect it has over a day or so....
I don't know if it helped or not. My observations after one day;

- memory consumption does not increase more than 550MB (varies 220-550MB);
- out of curiosity, I downgraded to .NET8.0.1 to see if it would help. It turned out that on CMXv4 it uses noticeably less by ~20MB.
- observing the consumption for CMXv3 and CMXv4, one get the impression that the latter uses an order of magnitude more memory. As if there was a comma moved to the right somewhere.

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 11:22 am
by mcrossley
Did anyone try the runtime config file I posted above? Any change?

If you could then try this version and let me know what happens - a slight concern that if there is a memory leak then MX will fail with an OOM error much sooner.

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 11:38 am
by Dador
I have downloaded the latest file and will monitor the situation.
I'll let know.

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 2:43 pm
by ConligWX
mcrossley wrote: Tue 09 Apr 2024 11:22 am Did anyone try the runtime config file I posted above? Any change?

If you could then try this version and let me know what happens - a slight concern that if there is a memory leak then MX will fail with an OOM error much sooner.

Mark. is this just for windows that you need to check or all OS's?

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 2:54 pm
by mcrossley
It's for all OS.

I have found that last config file gives out of memory errors when you request a lot of data from the select-a-period graphs :(

Third version will be incoming soon....

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 3:00 pm
by ConligWX
mcrossley wrote: Tue 09 Apr 2024 2:54 pm It's for all OS.

I have found that last config file gives out of memory errors when you request a lot of data from the select-a-period graphs :(

Third version will be incoming soon....
Problem with my system is I have 16gb of memory. it may take a while for me to be "Out of Memory" :lol: I'll grab the file now and install it now.

Re: CMXv4 Memory usage

Posted: Tue 09 Apr 2024 3:09 pm
by 92merc
I never really looked at CMXv3 memory usage before the upgrade. But my CMXv4 is using 274 Meg on my Windows 11 PC.

Funny how it's within a couple of Meg in usage vs. my WD install, and the normal operating memory usage for IPTimelapse. IPTL jumps to 600 megs at times, then right back down.