This depends on two things:
- Your deployment architecture
- Your OS that runs your process
If you are running on x86 on common mainstream Linux, Windows, BSD then
- each process has it's own private virtual RAM
- All segments text (code), heap, data are in the same logical address space (virtual RAM segment)
Historically x86 was designed with the ability to support segmented memory, but OSes never made use of it and support for it was initially dropped in AMD64. Though recent Processors support it again for use in virtualisation and Hypervisors. Userland applications are commonly deployed without segmentation today.