You may be waiting a long time for details responses to your problem unfortunately as there is not much activity on this forum. You are more likely to get the answers and solutions you need from the Open.MP Discord channels; try discord.com/invite/samp.
I also have a server but I've not had any memory problems but in my situation it doesn't matter because I set a timer to reset/refresh the server occasionally or the server will restart on a specific date. You could also restart the server at a time when there are no players detected online but limit that execution to once a day to prevent the server restart looping infinitely. My suggestion solution to your problem: automatic timed restart. On my server it also means all my timers are reset and vehicles are back in their proper spawn position and streamed objects are reloaded and in your situation your memory would also be refreshed, you see the advantage? I don't know much about MySQL (I don't use it) but perhaps there is a function to restart it daily too. You may consider my advice or try something else but I hope you solve your problem, I can understand your frustration of memory problems.
I also have a server but I've not had any memory problems but in my situation it doesn't matter because I set a timer to reset/refresh the server occasionally or the server will restart on a specific date. You could also restart the server at a time when there are no players detected online but limit that execution to once a day to prevent the server restart looping infinitely. My suggestion solution to your problem: automatic timed restart. On my server it also means all my timers are reset and vehicles are back in their proper spawn position and streamed objects are reloaded and in your situation your memory would also be refreshed, you see the advantage? I don't know much about MySQL (I don't use it) but perhaps there is a function to restart it daily too. You may consider my advice or try something else but I hope you solve your problem, I can understand your frustration of memory problems.