Skip navigation.
Home
The QNX Community Portal

View topic - Allocation of Message queues

Allocation of Message queues

For discussion of realtime and/or embedded programming.

Allocation of Message queues

Postby wednesday » Thu Dec 02, 2010 9:32 am

Hi,
I am using the mqueue implementation for creating queues in my app. I would like to know where and when is the memory used for queues allocated.
For ex if i create a queue of 1000 num of msg and each msg of 1024 bytes ,where and when will this much memory allocated? on ram or on disk.

thanks,
wednesday
Active Member
 
Posts: 48
Joined: Tue Apr 28, 2009 7:10 am

RE: Allocation of Message queues

Postby mario » Thu Dec 02, 2010 5:28 pm

Always in ram.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Allocation of Message queues

Postby wednesday » Fri Dec 03, 2010 5:59 am

Hi,
I ran a sample pgm in which i created queues of different sizes and checked the memory allocation thru showmem -P. However,in each instance i saw the same amountof memory being allocated on heap,stack etc .So where does exactly this memory go?and where can i view the meory allocation for queues.Does it get allocated in my application process address space or mqueue space ?
wednesday
Active Member
 
Posts: 48
Joined: Tue Apr 28, 2009 7:10 am

RE: Allocation of Message queues

Postby maschoen » Fri Dec 03, 2010 6:38 pm

mqueue allocates memory in it's own space.
mq allocates memory in the kernel's space.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest