View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-07-2004, 01:01 AM   #1
LQ Newbie
Registered: Sep 2004
Posts: 28

Rep: Reputation: 15
Stack Size Decision

hii group..
i m having a query abt how the stack size is decided...
V know that For a particualr programm v have 4 different or segments in memory...
1)Code segment
2)Data segment
3)Heap segment
4)Stack segment..

Now when v talk abt virtual memeory scenario its also known that 3 GB of memory is allocated by OS for these sections in all...

Starting or 0th byte given to the code segment n then proceeding upwards ..also the stack grows downwards frm the location 3rd GBth location.This whole is decided by OS...,ie.,Os decides the size of the complete memory allocated to these segments in all...

My questions r->

1).According to linux implementation v had 4 GB of Virtual Memory so "y it starts the stack with 3GB memory" ,ie,....Y it alloactes 3GB memory all these segments in all....Y cant 4GB full is allocated...

2)Also if i assume that i had no underlying OS n still i had to prform the task of alloacting space to all these segments then how i decide how much space is allocated to them in all..

3)Also How Stack ptr will b initialised?

4) In normal scenario how this stack ptr gets initialised...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 - new stack size? DJOtaku Fedora 2 10-07-2005 12:22 PM
How do you increase a kernel stack size? ginda Linux - Newbie 4 01-24-2005 06:52 PM
Stack size decision atul_mehrotra Programming 2 10-08-2004 04:32 AM
Kernel Stack Size option Corallis Linux - Newbie 2 09-07-2004 09:50 PM
C++ programs initial stack size. uncle_kevin Programming 1 07-05-2004 01:35 PM

All times are GMT -5. The time now is 03:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration