RAM Allocation on RPI 4 #1706
-
Posting here because I have not found much on the Raspberry Pi forums. I am running TShock on my Raspberry Pi 4 (4GB Model) and it runs, but not as well as it could. The server process itself is only using 500MB of ram, where as it could be using 2GB of ram since the Pi uses a x32 OS. Anyone have any ideas on increasing the ram that the process can use? Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I can understand your question from another perspective though, and that is this: Why does TShock suck on my Linux device? and the answer is complicated, though I will try to explain them as best as I can here: 1. Because that's how it isThe first and most frustrating answer is that's just the way it is. Re-Logic wrote Terraria on windows in .NET on an Intel CPU for windows on an Intel CPU. All optimization is either done on .NET or x86 CPUs themselves. Intel x86 is a vastly different architecture to ARM, and Intel have invested 40 years and billions into researching hardware optimizations for their chips, and it shows. Intel CPUs have a lot more special-purpose registers and speculative execution hardware that makes running code that much faster. Microsoft have also purchased Xamarin, which was the ARM port 2. Because it's a raspberry PIA Raspberry Pi is weak. The BCM2711B0 chip is so electrically low-powered that they are able to fit an entire system-on-chip (read: processor, GPU, RAM controller, I/O, etc) into a piece of silicon that doesn't even require a heatsink to operate. Gameservers are very intensive server applications because of the amount of geometry and collision calculations going on per second, and expecting it to run on a system that can be powered off a USB battery bank is not entirely reasonable. 3. Because the software itself sucksTerrariaServer is terribly written. It suffers from a number of poor performance problems stemming from the way it has been engineered from the vendor. Memory fragmentation, reference and GC bashing all contribute to a bad experience on non-windows hardware. The very fact that TShock has to even exist is a testament to both the lack of features and lack of performance of the vendor software; TShock developers such as myself have invested many hours into undoing the blatant misengineering of the software, enough to release a plugin that enables server operators to even have a hope of running a server naked on the internet. Game communities often pick up the slack of game vendors when the game is good enough to have a following, and Terraria is no exception. Linux performance of TShock has never been good even on Intel hardware, to the point that TShock refused to officially support it for the longest time. There are simply too many differences between Linux and Windows that gave us a hard enough time that we couldn't support it. To run a TShock server well you really require a 64-bit windows server with an Intel CPU at a reasonable clock speed. 8GB RAM is a bonus. It's not a convenient answer, but I hope this helps in explaining the situation with TShock. Cheers! |
Beta Was this translation helpful? Give feedback.
Hi,
Memory helps computers remember things and have no variables on performance. I think you are misconstruing what the purpose of memory is for in a computer and conflating lack of memory usage to poor performance. The only reason that memory would ever affect the performance of an application is because the kernel (in your case Linux itself) is swapping in virtual memory to/from a disk. Because the device in question is a Raspberry Pi I am going to assume that swapping is not enabled because it will kill an SD card in weeks, if not days.
I can understand your question from another perspective though, and that is this: Why …