Firstly, You should know if your source code ( c++ ) files are edited with stupid coding which makes infinite loops or applying non-important scripts.
Secondly, Yeah I agree with
@whitevo about addEvents, and also infinite loops are taking some ram ( but not much ) but when you have 400 players and 50 or more of them are looping ;it will cause lag on server or crashing the server or depending on the ram ( as you said 12 is high ram for a server ) would take mush ram, so try to look all your scripts --> I assure you know what you added which makes loop ( loops are like ( for - do-until - repeat-until ).
Thirdly, There are a sample of scripts which consume some ram like Game.getSpectators -> looping the function too much at same time would cause some problems and ram usage is one of them!
Solution :
By the first condition, try to get a new sources and discuss the codes you want to add with experienced members.
Second&Third one: I think everyone have a server know the scripts he have added and how it work, If they are public scripts you can discuss them within all members in support forum or discussions forum, else they are private you could start a conversation with trusted person but ask for their permission first to do this.
@HalfAway is a good person to discuss with, even
@Red or
@Jo3Bingham are also good. ( I just mentioned them as examples, and I don't say they accept on your own! )
(Stupid scripts) Don't consume the rat usage using a noob script while you can make a simple and even better script to run smoothly!
Regard, Slavi.