OpenQNX :: The QNX Community Portal

Oct 12, 2008 - 06:10 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 16 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
matt.uwa
Post subject: Swap File?  PostPosted: Apr 24, 2008 - 05:28 AM
New Member


Joined: Feb 06, 2008
Posts: 2

Hi, quick question about virtual memory under QNX...

Does QNX use a swap file? Various places seem to suggest that it doesn't:

e.g
http://www.openqnx.com/index.php?name=PNphpBB2&file=viewtopic&p=25054
www.itk.ntnu.no/fag/TTK4147/forelesninger/foiler/qnx63_rtos1.pdf

However I've been running some simple tests on the virtual memory system under QNX and was able to allocate up to 1.5 GB of memory to a single process (using mallocs) on a system which had only 1 GB of physical memory. I don't see how this would be possible without using a swap file.

Cheers,
Matt
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject: RE: Swap File?  PostPosted: Apr 24, 2008 - 11:37 AM
QNX Master


Joined: Sep 01, 2002
Posts: 2917

There is no swap file. Something is wrong in your test program.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
maschoen
Post subject: RE: Swap File?  PostPosted: Apr 24, 2008 - 03:24 PM
QNX Master


Joined: Jun 25, 2003
Posts: 1099

Be careful when you read the documentation. QNX does use Virtual memory. It does page memory to disk. Memory references are virtual because the connection between your virtual references and the "Real" memory are made by page tables, segment tables, via the processor.

I recall that QNX may not allocate all the real memory to the stack initially, but instead allocate it as you get faults, but you should never be able to allocate more memory than the system has in real.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
kwschumm
Post subject: RE: Swap File?  PostPosted: Apr 24, 2008 - 08:20 PM
Senior Member


Joined: Sep 17, 2004
Posts: 252

Mitchell probably meant to say that ... "It does NOT page memory to disk".
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: RE: Swap File?  PostPosted: Apr 25, 2008 - 02:11 AM
QNX Master


Joined: Jun 25, 2003
Posts: 1099

Ken, that's right, sorry.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
mario
Post subject: RE: Swap File?  PostPosted: Apr 25, 2008 - 03:51 AM
QNX Master


Joined: Sep 01, 2002
Posts: 2917

page memory to disk is actually somewhat true because you can memory map a file. However memory doesn't get to be swapped with a page file Wink
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
maschoen
Post subject: Re: RE: Swap File?  PostPosted: Apr 25, 2008 - 06:47 AM
QNX Master


Joined: Jun 25, 2003
Posts: 1099

mario wrote:
page memory to disk is actually somewhat true because you can memory map a file. However memory doesn't get to be swapped with a page file Wink


When you memory map a file, doesn't it all get loaded into memory? Or does it get loaded on demand? I thought it was the former.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
matt.uwa
Post subject: RE: Re: RE: Swap File?  PostPosted: Apr 29, 2008 - 01:29 AM
New Member


Joined: Feb 06, 2008
Posts: 2

Hi guys,
Thanks a lot for your replies, they were most helpful.
Turns out the test program was fine, the machine had 2GB of ram after all!
Stupid me. Embarassed
Cheers,
Matt
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.