Skip to contentSkip to conversation

switchtest fails with pthread_create: Cannot allocate memory

Xenomai-help Wolfgang Grandegger 2 participants 4 messages Jan 20, 2009 – Jan 25, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

when I try to run "switchtest" from the test-suite, I get the error

"pthread_create: Cannot allocate memory"

on my MPC5200 PowerPC board. Some resource is exhausted and likely it's system memory. I already realized heavy memory usage by threads using the Xenomai POSIX skin.

-bash-3.2# free
total used free shared buffers cached
Mem: 61280 12044 49236 0 0 5796

-bash-3.2# ./switchtest rtk0 rtk0 rtup0 rtup0 rtus0 rtus0 rtuo0

-bash-3.2# free
total used free shared buffers cached
Mem: 61280 59700 1580 0 0 3932

Any idea what could cause the exhaustive use of memory? Is it the same on x86? This test was done with Linux 2.6.26 i-Pipe 2.2-07 and Xenomai 2.4.x but it's the same with trunk.

Wolfgang.

#1 lore raw
Quoted 20 lines · Wolfgang Grandegger

Hello,

when I try to run "switchtest" from the test-suite, I get the error

"pthread_create: Cannot allocate memory"

on my MPC5200 PowerPC board. Some resource is exhausted and likely it's system memory. I already realized heavy memory usage by threads using the Xenomai POSIX skin.

-bash-3.2# free
total used free shared buffers cached
Mem: 61280 12044 49236 0 0 5796

(quoted diff) +0 -2
-bash-3.2# ./switchtest rtk0 rtk0 rtup0 rtup0 rtus0 rtus0 rtuo0
 
-bash-3.2# free
             total       used       free     shared    buffers     cached

Mem: 61280 59700 1580 0 0 3932

Quoted 3 lines

Any idea what could cause the exhaustive use of memory? Is it the same on x86? This test was done with Linux 2.6.26 i-Pipe 2.2-07 and Xenomai 2.4.x but it's the same with trunk.

It not is the stack size problem described in TROUBLESHOOTING ?

Signature · 1 line
                                                 Gilles.
#2 lore raw
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Wolfgang Grandegger

Hello,

when I try to run "switchtest" from the test-suite, I get the error

"pthread_create: Cannot allocate memory"

on my MPC5200 PowerPC board. Some resource is exhausted and likely it's system memory. I already realized heavy memory usage by threads using the Xenomai POSIX skin.

-bash-3.2# free
total used free shared buffers cached
Mem: 61280 12044 49236 0 0 5796

(quoted diff) +0 -2
-bash-3.2# ./switchtest rtk0 rtk0 rtup0 rtup0 rtus0 rtus0 rtuo0
 
-bash-3.2# free
             total       used       free     shared    buffers     cached

Mem: 61280 59700 1580 0 0 3932

Quoted 5 lines
Quoted 3 lines

Any idea what could cause the exhaustive use of memory? Is it the same on x86? This test was done with Linux 2.6.26 i-Pipe 2.2-07 and Xenomai 2.4.x but it's the same with trunk.

It not is the stack size problem described in TROUBLESHOOTING ?

Well, RTFM, it seems to be exactly the problem described in there. Setting "ulimit -s 2048" before starting "switchtest" helps.

Thanks.

Wolfgang.

#3 lore raw
Quoted 22 lines · Wolfgang Grandegger
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Wolfgang Grandegger

Hello,

when I try to run "switchtest" from the test-suite, I get the error

"pthread_create: Cannot allocate memory"

on my MPC5200 PowerPC board. Some resource is exhausted and likely it's system memory. I already realized heavy memory usage by threads using the Xenomai POSIX skin.

-bash-3.2# free
total used free shared buffers cached
Mem: 61280 12044 49236 0 0 5796

(quoted diff) +0 -2
-bash-3.2# ./switchtest rtk0 rtk0 rtup0 rtup0 rtus0 rtus0 rtuo0
 
-bash-3.2# free
             total       used       free     shared    buffers     cached

Mem: 61280 59700 1580 0 0 3932

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

Any idea what could cause the exhaustive use of memory? Is it the same on x86? This test was done with Linux 2.6.26 i-Pipe 2.2-07 and Xenomai 2.4.x but it's the same with trunk.

It not is the stack size problem described in TROUBLESHOOTING ?

Well, RTFM, it seems to be exactly the problem described in there. Setting "ulimit -s 2048" before starting "switchtest" helps.

What I do not understand is that switchtest sets the pthreads stack size to 20K, so we should not have this problem...

Signature · 1 line
					    Gilles.