title: Does object overhead matter when emulating a 6502 processor in Java? (using wrappers instead of primitive types)
body: <p>I'm programming an emulator in Java (currently working on the 6502 processor), and I'm planning to use my own wrappers for some primitive types, simply because it enables me to do some things easier. The problem is, I'm planning to emulate a complete NES console, and the CPU has access to 65536 bytes of memory. A primitive byte is 1 byte, a wrapper is AT LEAST 8 bytes. Creating an array of 65536 bytes (primitive) vs 65536 Bytes (wrapper) would cause at LEAST 8 times the amount of memory usage, not accounting for registers and whatnot. Not only that, but I can only assume that using objects instead of primitive types will be slower. What I'm wondering now is, since modern processors have gigs of RAM anyway, is it bad to use at least 8 times as much memory just to make it a bit easier on myself (and probably decrease the size of the emulator a little)? Or should I keep it efficient and just use primitive types?</p>