* [Xenomai-help] Resource leaking problem
@ 2006-09-08 11:44 Dirk Eibach
2006-09-08 11:58 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Dirk Eibach @ 2006-09-08 11:44 UTC (permalink / raw)
To: Xenomai help
Hello,
we have lots of tasks, semaphores and mutexes in our complex
application. Stopping and restarting seems to leak some resources,
because we get ENOMEM when a thread is created after restarting the
application, first time everything goes well.
Probably we do something wrong, maybe somebody can tell us what.
What do we have to do in order to clean up all resources properly,
especially if our application is ended by SIGKILL?
Cheers.
--
Dirk Eibach <eibach@domain.hid>
Guntermann & Drunck Systementwicklung GmbH
F & E
Dortmunder Str. 4a, D-57234 Wilnsdorf
Tel.: +49 (0) 2739 8901 100, Fax.: +49 (0) 2739 8901 120
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Resource leaking problem
2006-09-08 11:44 [Xenomai-help] Resource leaking problem Dirk Eibach
@ 2006-09-08 11:58 ` Jan Kiszka
2006-09-08 12:43 ` Gilles Chanteperdrix
[not found] ` <45015E28.7080405@domain.hid>
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-09-08 11:58 UTC (permalink / raw)
To: Dirk Eibach; +Cc: Xenomai help
[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]
Dirk Eibach wrote:
> Hello,
>
> we have lots of tasks, semaphores and mutexes in our complex
> application. Stopping and restarting seems to leak some resources,
> because we get ENOMEM when a thread is created after restarting the
> application, first time everything goes well.
>
> Probably we do something wrong, maybe somebody can tell us what.
What skin do you use? Native? Only the POSIX skin currently does
auto-cleanup, the others require explicit care.
>
> What do we have to do in order to clean up all resources properly,
> especially if our application is ended by SIGKILL?
Install a signal handler and do cleanup of all allocated objects (tasks
get deleted when they terminate). Either keep track of your allocated
resources in some list(s) or signal the owners (tasks) that they should
terminate and cleanup their locally allocated resources. There are
dozens of ways to do this, depending on your application design.
But if you think that you are cleaning up correctly and still face
leaks, try to derive a simple test that demonstrates the issue.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Resource leaking problem
2006-09-08 11:58 ` Jan Kiszka
@ 2006-09-08 12:43 ` Gilles Chanteperdrix
[not found] ` <45015E28.7080405@domain.hid>
1 sibling, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-09-08 12:43 UTC (permalink / raw)
To: xenomai
Jan Kiszka wrote:
> > What do we have to do in order to clean up all resources properly,
> > especially if our application is ended by SIGKILL?
>
> Install a signal handler and do cleanup of all allocated objects (tasks
> get deleted when they terminate).
Installing a signal handler for SIGKILL will not work, you should try
and handle SIGTERM gracefully, and accept, in case of SIGKILL (which
should remain rare anyway) to have to unload/reload Xenomai if it is
compiled as a module, or reboot if it is built-in.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: (WARNING!!! PGP with incorrect signature) Re: [Xenomai-help] Res
[not found] ` <45015E28.7080405@domain.hid>
@ 2006-09-08 12:59 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-09-08 12:59 UTC (permalink / raw)
To: Dirk Eibach; +Cc: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]
Dirk Eibach wrote:
> jan.kiszka@domain.hid wrote:
>> Dirk Eibach wrote:
>>> Hello,
>>>
>>> we have lots of tasks, semaphores and mutexes in our complex
>>> application. Stopping and restarting seems to leak some resources,
>>> because we get ENOMEM when a thread is created after restarting the
>>> application, first time everything goes well.
>>>
>>> Probably we do something wrong, maybe somebody can tell us what.
>>
>> What skin do you use? Native? Only the POSIX skin currently does
>> auto-cleanup, the others require explicit care.
>
> We are using native skin, so that explains the problem we are facing.
> Thanks.
>
>>> What do we have to do in order to clean up all resources properly,
>>> especially if our application is ended by SIGKILL?
>>
>> Install a signal handler and do cleanup of all allocated objects (tasks
>> get deleted when they terminate). Either keep track of your allocated
>> resources in some list(s) or signal the owners (tasks) that they should
>> terminate and cleanup their locally allocated resources. There are
>> dozens of ways to do this, depending on your application design.
>>
>> But if you think that you are cleaning up correctly and still face
>> leaks, try to derive a simple test that demonstrates the issue.
>
> Hmmm, wouldn't it be clever to have a syscall that would allow us to
> free all xenomai resources at once, so we could call it on application
> startup? Otherwise SIGKILL will still be a problem.
Actually, the per-process cleanup is what we should head for also under
the other skins. It will also address SIGKILL (which cannot be caught by
a handler, of course). As most of us only have one brain to think and
two hands to hack, and those are also shared resources ;), support is
always welcome.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-09-08 12:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-08 11:44 [Xenomai-help] Resource leaking problem Dirk Eibach
2006-09-08 11:58 ` Jan Kiszka
2006-09-08 12:43 ` Gilles Chanteperdrix
[not found] ` <45015E28.7080405@domain.hid>
2006-09-08 12:59 ` (WARNING!!! PGP with incorrect signature) Re: [Xenomai-help] Res Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.