Fork us on GitHub Follow us on Google+ Follow us on Facebook Follow us on Twitter

Opened 2 months ago

Closed 6 weeks ago

Last modified 4 weeks ago

#744 closed defect (fixed)

Spawning tasks leaks memory

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.8.0
Component: helenos/kernel/generic Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

Each spawned task (apparently independent of any particular task, but for example tester) will leak a little bit of memory, as can be observed in the top utility. Repeated spawning of such a task will eventually reach the point when it is no more possible to spawn new tasks.

Attachments (4)

stats1 (4.9 KB) - added by Jakub Jermář 6 weeks ago.
stats40 (4.9 KB) - added by Jakub Jermář 6 weeks ago.
kmem-before (3.4 KB) - added by Jakub Jermář 6 weeks ago.
kmem-after (3.4 KB) - added by Jakub Jermář 6 weeks ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 weeks ago by Jakub Jermář

The leak is probably in the kernel because comparing the output of the stats command after 40 executions does not reveal any leak in the virtual memory allocated by the running tasks, including servers. (In my setup, running stats command 47 tasks depletes the available memory). See the attached stats1 and stats40 commands for comparison.

Changed 6 weeks ago by Jakub Jermář

Attachment: stats1 added

Changed 6 weeks ago by Jakub Jermář

Attachment: stats40 added

comment:2 Changed 6 weeks ago by Jakub Jermář

Further investigation shows that there might be some as_t structure lying around (as well as some malloc-256 size buffers). See kmem-before and kmem-after attachments.

Changed 6 weeks ago by Jakub Jermář

Attachment: kmem-before added

Changed 6 weeks ago by Jakub Jermář

Attachment: kmem-after added

comment:3 Changed 6 weeks ago by Jakub Jermář

Git bisect reveals that:

78de83de52a9115dc77b09bb7029403dad8c2fb0 is the first bad commit
commit 78de83de52a9115dc77b09bb7029403dad8c2fb0
Author: Jiří Zárevúcky <jiri.zarevucky@nic.cz>
Date:   Fri Sep 7 17:41:29 2018 +0200

    Improve kernel spinlock and AS refcount.

comment:4 Changed 6 weeks ago by Jakub Jermář

Resolution: fixed
Status: newclosed

comment:5 Changed 4 weeks ago by Jakub Jermář

Component: helenos/unspecifiedhelenos/kernel/generic
Note: See TracTickets for help on using tickets.