473,699 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is a *Page*?

Hi,

I'm viewing this stack overflow help page (
http://support.microsoft.com/kb/315937 ) at the ms support site. I cant say
I understand the concept of a "page" the way its used in this
example/explanation. I mean I only am aware of the *simple*, *general*,
paging concept, the one that is discussed often when explaning how an
operating system can support more memory than actually is available by doing
paging on the hard drive (and that also only at a higher-level theoratical
concept). Although the "page"/"page guard"/etc thats referenced here *feels*
something like that but nothing makes sense to me.
For example take this sentence:

"The stack then grows on demand to meet the needs of the thread. This is
implemented by placing a page with PAGE_GUARD access at the end of the
current stack."

here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.

- is "stack" some linked list kind of dynamically growing LIFO data
structure? Are the contents of this stack these (unknown for me) "pages", in
which case if the stack size is 5 than there will be 5 pages?

plz clarify...
Regards,

...ab
Jan 19 '07 #1
7 1314
"Abubakar" <em**********@y ahoo.comwrote in message
news:uY******** ******@TK2MSFTN GP06.phx.gbl...
here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.
On an operating system that uses virtual memory, a page is the smallest
amount of memory which is moved in one go from the page file to physical
memory. If you need to know how much memory is in a page, you call
GetSystemInfo() .
- is "stack" some linked list kind of dynamically growing LIFO data
structure?
No. The stack is a contiguous region of memory. By default, it is 1MB large.
But like every other region of memory in Windows it is virtual memory.
Address ranges of memory in the stack region are backed ("committed" ) by
physical memory on an as needed basis.
Are the contents of this stack these (unknown for me) "pages", in which
case if the stack size is 5 than there will be 5 pages?
It's a rare application which measures the size of anything in pages. The
stack is no different, it is measured in bytes.

Why do you need to know?

Regards,
Will
Jan 19 '07 #2
On Fri, 19 Jan 2007 20:34:29 +0500, "Abubakar" <em**********@y ahoo.com>
wrote:
>Hi,

I'm viewing this stack overflow help page (
http://support.microsoft.com/kb/315937 ) at the ms support site. I cant say
I understand the concept of a "page" the way its used in this
example/explanation. I mean I only am aware of the *simple*, *general*,
paging concept, the one that is discussed often when explaning how an
operating system can support more memory than actually is available by doing
paging on the hard drive (and that also only at a higher-level theoratical
concept). Although the "page"/"page guard"/etc thats referenced here *feels*
something like that but nothing makes sense to me.
For example take this sentence:

"The stack then grows on demand to meet the needs of the thread. This is
implemented by placing a page with PAGE_GUARD access at the end of the
current stack."

here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.
A page is the smallest unit of memory the Windows virtual memory system
deals with. Look up VirtualAlloc, and you'll find a lot of info on pages.
- is "stack" some linked list kind of dynamically growing LIFO data
structure?
No, a thread's stack is a contiguous region of memory that grows
dynamically up to its maximum configured size as the thread pushes data
into the guard page, which causes a structured exception, which further
causes the OS to commit the page and create a new guard page just below it.
>Are the contents of this stack these (unknown for me) "pages", in
which case if the stack size is 5 than there will be 5 pages?
It's a lot more common to measure in bytes; when there's doubt, you should
specify the units, as I'm sure the Mars Climate Orbiter people wish they
had done.

You should search MSDN for PAGE_GUARD. This article talks about it, but its
example doesn't illustrate using it to grow a stack:

http://msdn2.microsoft.com/en-us/library/aa366549.aspx

This one talks about reserving and committing memory and shows how to use
structured exceptions to handle page faults to grow an array:

http://msdn2.microsoft.com/en-us/library/aa366803.aspx

What the system does with the thread stack lies somewhere in between...

--
Doug Harrison
Visual C++ MVP
Jan 19 '07 #3
Hey thanks for the useful links and the explanation. I'll have to read a lot
before being able to ask more on this topic.

Regards,

...ab

"Doug Harrison [MVP]" <ds*@mvps.orgwr ote in message
news:ih******** *************** *********@4ax.c om...
On Fri, 19 Jan 2007 20:34:29 +0500, "Abubakar" <em**********@y ahoo.com>
wrote:
>>Hi,

I'm viewing this stack overflow help page (
http://support.microsoft.com/kb/315937 ) at the ms support site. I cant
say
I understand the concept of a "page" the way its used in this
example/explanation. I mean I only am aware of the *simple*, *general*,
paging concept, the one that is discussed often when explaning how an
operating system can support more memory than actually is available by
doing
paging on the hard drive (and that also only at a higher-level theoratical
concept). Although the "page"/"page guard"/etc thats referenced here
*feels*
something like that but nothing makes sense to me.
For example take this sentence:

"The stack then grows on demand to meet the needs of the thread. This is
implemented by placing a page with PAGE_GUARD access at the end of the
current stack."

here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.

A page is the smallest unit of memory the Windows virtual memory system
deals with. Look up VirtualAlloc, and you'll find a lot of info on pages.
>- is "stack" some linked list kind of dynamically growing LIFO data
structure?

No, a thread's stack is a contiguous region of memory that grows
dynamically up to its maximum configured size as the thread pushes data
into the guard page, which causes a structured exception, which further
causes the OS to commit the page and create a new guard page just below
it.
>>Are the contents of this stack these (unknown for me) "pages", in
which case if the stack size is 5 than there will be 5 pages?

It's a lot more common to measure in bytes; when there's doubt, you should
specify the units, as I'm sure the Mars Climate Orbiter people wish they
had done.

You should search MSDN for PAGE_GUARD. This article talks about it, but
its
example doesn't illustrate using it to grow a stack:

http://msdn2.microsoft.com/en-us/library/aa366549.aspx

This one talks about reserving and committing memory and shows how to use
structured exceptions to handle page faults to grow an array:

http://msdn2.microsoft.com/en-us/library/aa366803.aspx

What the system does with the thread stack lies somewhere in between...

--
Doug Harrison
Visual C++ MVP

Jan 20 '07 #4
Hi,
thanks for the nice explanation.
Why do you need to know?
Well, I was going through the kb site on microsoft support and it showed how
I could catch the stack overflow exception and handle it and the talk was
all about "pages". I have heard about pages before but I thought that
finally I need to remove my confusion and build up some knowledge about this
concept so I wont have any confusions in the future when somebody mentions
"stack" or "pages" or "heap" etc.

If u find/know any links related to these concepts, do share here.

Regards,

...ab

"William DePalo [MVP VC++]" <wi***********@ mvps.orgwrote in message
news:Oq******** ********@TK2MSF TNGP02.phx.gbl. ..
"Abubakar" <em**********@y ahoo.comwrote in message
news:uY******** ******@TK2MSFTN GP06.phx.gbl...
>here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.

On an operating system that uses virtual memory, a page is the smallest
amount of memory which is moved in one go from the page file to physical
memory. If you need to know how much memory is in a page, you call
GetSystemInfo() .
>- is "stack" some linked list kind of dynamically growing LIFO data
structure?

No. The stack is a contiguous region of memory. By default, it is 1MB
large. But like every other region of memory in Windows it is virtual
memory. Address ranges of memory in the stack region are backed
("committed" ) by physical memory on an as needed basis.
>Are the contents of this stack these (unknown for me) "pages", in which
case if the stack size is 5 than there will be 5 pages?

It's a rare application which measures the size of anything in pages. The
stack is no different, it is measured in bytes.

Why do you need to know?

Regards,
Will


Jan 20 '07 #5
"Abubakar" <em**********@y ahoo.comwrote in message
news:O7******** ********@TK2MSF TNGP06.phx.gbl. ..
thanks for the nice explanation.
You are welcome.
Well, I was going through the kb site on microsoft support and it showed
how I could catch the stack overflow exception and handle it and the talk
was all about "pages". I have heard about pages before but I thought that
finally I need to remove my confusion and build up some knowledge about
this concept so I wont have any confusions in the future when somebody
mentions "stack" or "pages" or "heap" etc.
Well, first you have to remember that the stack by deafult is 1MB large.
Your application shouldn't have to worry in general about overflowing the
stack. If it does overflow it, that's generally due to one of two main
causes:

1) a recursive algorithm recursing too much <g>
2) the allocation of a very large "automatic" array on the stack

One deals with the first problem by recasting an algorithm, and with the
second by moving the allocation to the heap.

Regards,
Will
Jan 20 '07 #6

"Abubakar" <em**********@y ahoo.comwrote in message
news:uY******** ******@TK2MSFTN GP06.phx.gbl...
Hi,

I'm viewing this stack overflow help page (
http://support.microsoft.com/kb/315937 ) at the ms support site. I cant
say I understand the concept of a "page" the way its used in this
example/explanation. I mean I only am aware of the *simple*, *general*,
paging concept, the one that is discussed often when explaning how an
operating system can support more memory than actually is available by
doing paging on the hard drive (and that also only at a higher-level
theoratical concept). Although the "page"/"page guard"/etc thats
referenced here *feels* something like that but nothing makes sense to me.
For example take this sentence:
While a emulating additional memory using a swap file uses paging as its
implementation (in most OSes, including Windows), it is not the definition
of paging/virtual memory. It's extremely useful for isolating user-mode
processes from each other for security and reliability, and dynamic memory
commitment. A good place to start is by reading up on virtual memory and
the Translation Look-aside Buffer (TLB).

http://en.wikipedia.org/wiki/Virtual_memory
http://en.wikipedia.org/wiki/Page_fault
http://en.wikipedia.org/wiki/Page_table
http://en.wikipedia.org/wiki/Transla...okaside_Buffer
>
"The stack then grows on demand to meet the needs of the thread. This is
implemented by placing a page with PAGE_GUARD access at the end of the
current stack."

here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.

- is "stack" some linked list kind of dynamically growing LIFO data
structure? Are the contents of this stack these (unknown for me) "pages",
in which case if the stack size is 5 than there will be 5 pages?

plz clarify...
Regards,

..ab


Jan 22 '07 #7
Thanks.

...ab

"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:u7******** ******@TK2MSFTN GP05.phx.gbl...
>
"Abubakar" <em**********@y ahoo.comwrote in message
news:uY******** ******@TK2MSFTN GP06.phx.gbl...
>Hi,

I'm viewing this stack overflow help page (
http://support.microsoft.com/kb/315937 ) at the ms support site. I cant
say I understand the concept of a "page" the way its used in this
example/explanation. I mean I only am aware of the *simple*, *general*,
paging concept, the one that is discussed often when explaning how an
operating system can support more memory than actually is available by
doing paging on the hard drive (and that also only at a higher-level
theoratical concept). Although the "page"/"page guard"/etc thats
referenced here *feels* something like that but nothing makes sense to
me.
For example take this sentence:

While a emulating additional memory using a swap file uses paging as its
implementation (in most OSes, including Windows), it is not the definition
of paging/virtual memory. It's extremely useful for isolating user-mode
processes from each other for security and reliability, and dynamic memory
commitment. A good place to start is by reading up on virtual memory and
the Translation Look-aside Buffer (TLB).

http://en.wikipedia.org/wiki/Virtual_memory
http://en.wikipedia.org/wiki/Page_fault
http://en.wikipedia.org/wiki/Page_table
http://en.wikipedia.org/wiki/Transla...okaside_Buffer
>>
"The stack then grows on demand to meet the needs of the thread. This is
implemented by placing a page with PAGE_GUARD access at the end of the
current stack."

here I'm confused.
- What is a "page" here? Is it some data structure? What do they contain?
Can we see it? Is it documented? I need the links to its docs.

- is "stack" some linked list kind of dynamically growing LIFO data
structure? Are the contents of this stack these (unknown for me) "pages",
in which case if the stack size is 5 than there will be 5 pages?

plz clarify...
Regards,

..ab



Jan 31 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
2638
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in directly. so I need a way doing this. so I check to see if the ifp value is null and if so then assign it a value. is this correct?
6
2009
by: Doc | last post by:
I'm trying to get to the bottom of a problem I've been having with publishing a freebie website. I'm using a program called WebEasy. Using a very simple site upload as an example, in this case a picture of a couple of antique chairs. I paste a single .jpg image, and save the web page file, which gets saved as an .alb file. Then, after choosing the "build website" function, the following files are found in the folder for the website:
9
2146
by: Just D. | last post by:
All, Did anybody see this strange effect? The web application is written in C#, ASP.NET, SQL, T-SQL, etc. A pretty usual stuff, complicated enough, but works fine until... Here is a question. I don't see any problem if I start this app on my local computer against my local IE both in debug or release modes. If I upload the same app to my corporate server where it works under HTTPS here are a few possible ways.
3
2466
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a button inside a-tag with attribute target isn't anything new relating ASP.Net, its same old HTML). He claimed that you could change another page´s controls´s property´s value from another frame by using this method: ' Page "Bottom"
9
2222
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
37
5966
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes in a separate file from the HTML. Apart from the obvious advantage if you have a separate designer and programmer, are there any other advantages to code behind? Most of the stuff I've seen so far uses code inside, but that's probably
9
3190
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
11
14819
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be processed by the web server. I am still struggling to understand this postback logic, and hope that some kind gurus out there could help me clarify the confusion I have.
11
3522
by: emailus | last post by:
I am webmaster for the domain <www.alpha1.org.au>. Not being an expert in html, I take advantage of my domain Registrant's web building tool, 'Instant Website'. This tool is provided as part of the fee I pay for web hosting. 'Instant Website' provides the option of having your opening page as a Flash Page, which you'll see if you visit <www.alpha1.org.au>. Well, you'll see it if you visit from a Windows machine. For some reason, when...
6
3852
by: Sunfire | last post by:
Is there a way you can test what page is loaded from inside a master page? What I need to do is test to see what page is loaded inside the master page and then gray out the root item linked to that page in the Menu control. I.e. I have a root item called home. When a person is on the home page I want it to be disabled. Any way to do this?
0
8691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7755
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6536
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2351
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2012
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.