Is memory shared on client-server architecture for a localhost?
I was looking at the client-server architecture and wondered if the client and server share the same memory when the client is also running the server on the same machine (localhost) (think singleplayer Minecraft).
So say the server has a list of entities, the client also needs to know about those entities so the server sends that information over to the client. The client now has a copy of the entities and so does the server taking up effectively 2x memory.
With a singleplayer game, had there been no server/client side code the entities would only exist once and therefore take up half the memory that a client/server would. However, when the server is localhost i.e., the server and client are running as the same application, there is no need to copy the entities twice, however, I assume, they are copied twice.
Is this behaviour just ignored/taken as an acceptable tradeoff (if it exists)? Is there a reasonably straightforward solution to this problem should the duplicated memory matter?