473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

memory segments in c

how can we define the memory segments in C.
and how many segments are there available in C
where local and global variable stored...?
Sep 30 '11 #1
1 2088
Banfa
9,065 Expert Mod 8TB
Strictly there are no memory segments in C since C is platform independent and memory segments are dependent on the platform.

However on the whole (i.e. in most cases) you have the following memory segments

code or text - carrying the program code
bss - carrying uninitialised or 0 initialised global variables
data - carrying initialised global variables
rodata - some platforms have a read only data segment and if they have it they can often put it into physically read only memory
stack - carrying all local variables, function parameters and processor state normally in stack frames
heap - the segment reserved to meet malloc allocations

Note that, confusingly, in some contexts the data segment refers to everything that is not the text segment.
Sep 30 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Erik Hendrix | last post by:
Hi, I was wondering if some people could help me here, I've been trying to use pmap on the DB2 processes to determine how much memory in total we are consuming for DB2 (shared + private). Now...
12
by: Jeremy | last post by:
Hi all, I'm getting very confused about how DB2 uses shared memory and I wonder if someone could clarify matters for me, please ? We are running 32bit DB2 V7.2 FP9 under AIX 4.3.3 on a machine...
5
by: Jim | last post by:
Hello, I have a broken server that we are going to be moving off to a new server with a new version of DB2 but here is what I have right now: RedHat 7.0 (2.2.24smp) DB2 v6.1.0.40 I am...
2
by: Ember | last post by:
For once, I have a customer that is more concerned with reducing the memory usage than with increasing performance - a new direction in tuning for me. I'm looking at db2 agent processes on the...
10
by: Alex Greem | last post by:
Dear all, Our database (DB2 Workgroup 7.2 FP12) is constantly under heavy load. Most time CPU usage (1 Pentium3 1Ghz) is more 50% busy. We have 3GB RAM memory Our normal workload is 200-300...
4
by: PaulR | last post by:
Hi, We have a Server running SLES 8 and 3GB memory, with 1 DB2 instance and 2 active Databases. General info... DB2level = "DB2 v8.1.0.72", "s040914", "MI00086", and FixPak "7" uname -a =...
29
by: keredil | last post by:
Hi, Will the memory allocated by malloc get released when program exits? I guess it will since when the program exits, the OS will free all the memory (global, stack, heap) used by this...
35
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension I maintain, I need a way to test that the leak is...
1
by: phantom2850 | last post by:
hello friends, I recently attended 3 interviews, all three had similar questions... Where is const stored? what are diff segments? what is heap? where is it on RAM/ROM? what is stored in...
0
by: neverMind | last post by:
Hi there, I have an assignment to invert a ppm image, with a header of 4 lines (P6\nwidth\nheight\ndepth\n),and we have to do a shared memory version and a memory mapped file (MMF) too. This...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.