From what I have found so far it's clear that programs compiled for a 64-bit architecture use twice as much RAM for pointers as their 32-bit alternatives - https://superuser.com/questions/56540/32-bit-vs-64-bit-systems.
Does that mean that code compiled for 64-bit uses on average two times more RAM than the 32-bit version?
I somehow doubt it, but I am wondering what the real overhead is. I suppose that small types, like short
, byte
and char
are same sized in a 64-bit architecture? I am not really sure about byte
though. Given that many applications work with large strings (like web browsers, etc.), that consist mostly of char
arrays in most implementations, the overhead may not be so large.
So even if numeric types like int
and long
are larger on 64 bit, would it have a significant effect on usage of RAM or not?
The theoretical memory limit that a 64-bit computer can address is about 16 exabytes (16 billion gigabytes), Windows XP x64 is currently limited to 128 GB of physical memory and 8 TB of virtual memory. In the future this limit will be increased, basically because hardware capabilities will improve.
A 64-bit register can theoretically reference 18,446,744,073,709,551,616 bytes, or 17,179,869,184 GB (16 exabytes) of memory. This is several million times more than an average workstation would need to access.
The reasons to go 64-bit include greater access to memory for 64-bit applications, access to more than 4GB of physical RAM (although often systems only see around 3GB because other devices use up the memory address space), and improved security capabilities.
A 64-bit processor refers to a microprocessor that can process data and instructions in chunks of 64 bits. Microprocessors that can handle 64 bits perform a larger number of calculations per second compared to 32-bit processors.
It depends on the programming style (and on the language, but you are referring to C).
double
or int32_t
, RAM consumption does not go up.int
or long
, it depends on the architecture; there may be differences between Linux and Windows. Here you see the alternatives you have. In short, Windows uses LLP64, meaning that long long
and pointers are 64 bit, while Linux uses LP64, where long
is 64 bit as well. Other architectures might make int
or even short
64 bit as well, but these are quite uncommon.float
and double
should remain the same in size in all cases.So you see it strongly depends on the usage of the data types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With