The ram usage is only an issue when you are running maps like global tibia with a billion tiles and still using the "otbm" format that was created as a revolutionary memory saver (compared to xml) like two decades ago. The tile class, the otbm, and all other data structures centered around those two, desperately need reworked to become lighter, and that will aid in the endeavor to lessen the RAM usage... but there are a lot of other places for these potential optimizations as well, its just not a huge focus for teams built for replicating real tibia and it's features.
I have personally already removed the virtualization of the tile class, as well as removed all its leaf classes, in attempt at lowering the memory footprint of each tile. There are of course several other things that need addressed that could reduce the memory footprint of the server itself, but most projects just aim to emulate tibia, and so it will never be their priority for such things (as far as I can tell).
I agree, I mean using TFS or any other public distro as it is today is fine for playing with friends or a small community, but it is very far from being a serious productive server if you don't personally fix it's flaws, no matter if it's canary, nostalrius or any other public distro as long it's forked from TFS.
There are several posts that address the problems and TFS developers are very aware of it, I ignore why these problems haven't been fixed to this date.
But to address the most criticals:
Bottleneck: Single core design, main thread doing live database calls can freeze entire world. Most noticeable when players log in or logout.
Pathfinding: Very expensive resource wise.
Items duplications: As long as you can crash the engine, it's very likely to be able to dup items on TFS. Since players are saved upon logout or death, they are not aligned with house tiles or other players, so the data persistency is not consistent. It just takes a player to:
pickup an item from a house tile, logout (item is now saved into player inventory), crash server. Since house tiles are saved only on server save, you will have now item on house tile and also dupped on player inventory. You can do basically the same with two players, no house needed.
If you take a look at the tarball you will instantly notice depot inventory is loaded on step in, not on player login, that's a core mechanic of tibia that shouldn't be so off in TFS (because it also takes part on decay mechanic, which is also not working properly on public distros) and would help to improve greatly the bottleneck, not to mention the use of pthreads that cipsoft did back in 2007, and using a proper querymanager to communicate between the server and database.
Cipsoft also addressed items dups decades ago, and we have the binary files there.
TFS would improve greatly just taking a look at it.
Even TFS's raid mechanic is non-sense, checking every x seconds to throw dices and see if it should trigger or not a raid. If devs would take a look at the real thing, the tarball just threw the dices once on server startup and scheduled all the raids for the day, no need to be wasting resources very x second to do calculations the entire time. Not to mention raids have two categories, BigRaids and SmallRaids, which are critical to properly schedule them.
Right now, as how TFS is, you won't be able to trigger rookgaardrats raid or any other intended daily raid using the daily value parameter, because it can just miss all the dices throws in a day.
There are many other things that might be improved, like making custom loot for creatures on raid (instead of creating a custom orc warlord to just add amazon loot lol), dissapear monsters after x time (just like cipsoft did with many raids), etc.
I may be wrong in some points since It's been a while I don't check at TFS, my apologies if some of the points I stated are wrong. But I believe the correct direction would be to reverse engineering the tarball, get the best possible things out of it, implement on TFS, address the bugs and then keep moving on to catch whatever tibia turned into nowadays, if that's even still the goal lol.