In comparison, Arudino is a much bigger memory hog than C# or Java on a non-embedded system (desktop/server). I never ran out of memory there and it was never a consideration.
LOL! Java is a massive memory hog. Many megabytes
of ram for simple apps, and it keeps growing. Don't try and use it for anything serious in an embedded environment, even if you have 256Mb of ram to spare.
I don't see how you can seriously compare a Java app running on a desktop to what you want to do on an Arduino with 2Kb of RAM.
The Arduino uses C++, with libraries optimized for low memory use. The String library is a C++ library with very poor low memory characteristics. Be smarter and don't use it.