I have a suspected memory leak in a module I’ve developed which is quite hard to isolate. Essentially my servers max out their memory after pretty much exactly 12 days of running, sending the CPU usage up to 100% and causing Wowza to stop working.
I’m no Java expert, let alone a memory expert, but I can guess where I might be going wrong. One of my custom modules I’ve developed uses the Java class ScheduledThreadPoolExecutor to update a database every 10 seconds and I’m thinking a small inefficiency in the code that gets executed is causing memory to gradually get eaten up. If a connection is established each time the update runs, could that be it? Or perhaps not correctly closing statements? I realise it could be put down to any number of things but given I am a Java novice, knowing the obvious things might help.
I did a debug of free memory using runtime.freeMemory() and it did seem to decrease slightly with every update, but that could well have been something else on my system, I’m just not sure.
Any insight at all would be greatly appreciated. Thanks