Gilles Chanteperdrix wrote: > [EMAIL PROTECTED] wrote: > > Xenomai Version : 2.2-rc2 > > Skin : native > > Kernel : 2.4.25 > > Arch.: PPC > > > > I try to allocate as much memory as possible with the functions : > > rt_heap_create and > > rt_heap_alloc. > > (see also "Xenomai heap services" in this mailing list; see source > > attached) > > > > When I try to use the allocated memory with memset, the Xenomai-task > > crashes with a "Segmentation fault". > > > > Is memset allowed to be used with Xenomai heaps ? > > memset should work with Xenomai heaps, I suspect your problem is rather > that the memory is not really allocated until you memset it, which fails > when no memory is available. In this case, calling memset on memory > allocated with malloc should segfault the same way when the system > memory is exhausted. IIRC, this behaviour is documented in mlockall > manual page.
I wonder if this "virtual allocation" also applies to vmalloc'ed memory like in this case. I don't think so, or the kernel would oops as well. > > Be careful with sysconf(_SC_AVPHYS_PAGES), it may include the swap size, > but when mlocking memory, your application can not use swap pages, so, > you should substract the size of swap, if any. > Also, what is the value of /proc/sys/vm/overcommit_memory on your system > ? > Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list Xenomai-help@gna.org https://mail.gna.org/listinfo/xenomai-help