Clock drift and Garbage Collection

We have a small system that is still under development that have issues with Clock Drift,
I looked into the general guide but that didn't help much,

If the gateway is restarted it works fine during the day until it for some reason starts to consume memory and when GC gives the memory back is causes clock drift, at least that what it looks like to me.

Next step I presume would be to find out what is causing the memory allocation that increases suddenly,

What tool or procedure should i use to try to pinpoint what is consuming memory all of a sudden.

EDIT:
Some extra info:
It runs on a high end laptop at the moment, a windows 11 machine.
Exclusion have been done for anti virus with the recommendation from Inductive Automation.
Power settings is always on. Local admin account is used.

SQL express is installed on the computer.

The application is not used during the night, the computer is idle basically.
In the gateway under performance i see no scripts running.

Tested to download diagnostic package and backup of the gateway and dumped that into gpt 5.5 to analyse which didnt find anything particular out of the ordinary, except that the clock drift seems to be related to GC

I have now installed OpenJDK 17.0.17 and is running

.\jcmd.exe 10980 JFR.start name=heapcycle settings=profile duration=12h maxsize=4096m filename=C:\IgnitionLogs\heapcycle_12h.jfr

to collect information about heap.

This is actually something hard to do.

In our project, and talking from my experience, we had to "take apart" what was causing the memory leaks.
In our case it was a mix of poorly designed scripts and lots of redundant reads and writes to bd.

You should start to looking into your gateway. Check the status > Diagnostics section. There you can check the logs, the current scripts and how many threads are running.

Also, Ignition is designed to collect a lot of memory and then clean it all. It is normal to see the step-type graph you are seeing (but not normal the clock drift).

Are you running Ignition on a VM server?

No this runs on a high end windows 11 machine.

I'll update info in the topic

Not surprised. Windows 11 isn't a server operating system, why would it be set up for optimal service resource usage? There are good reasons why desktop OS' are not supposed to be used for servers. Cr*ppilot probably has higher resource priority than a JVM...

Aside from that, same hardware with a linux server OS and I would happily wager you would see none of these issues.

It will be moved to different hardware and windows IoT when we are done with the system. Don't mind using linux for the server but in this case we will not.

Anyway, need to figure out what is causing the issue for this one. Whatever is causing the heap to grow shouldn't be impossible to figure out.

Again, this is not a server OS, why are you running a server on it?

Heaps grow until they hit a 80% ish mark, then the JVM pauses, then clears out memory that is allocated to functions that are no longer part of execution. That is normal behaviour.

This is a small all in one solution of a HMI for a machine, so it will be running the gateway and client on the same machine. Some basic logging and indicators and a few controls. Installing windows 2025 server for that seems like a unnessesary cost considering the application. But if the gateway can't run properly in windows 11 we might have to reconsider.