Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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 years ago.
stats40 (4.9 KB ) - added by Jakub Jermář 6 years ago.
kmem-before (3.4 KB ) - added by Jakub Jermář 6 years ago.
kmem-after (3.4 KB ) - added by Jakub Jermář 6 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Jakub Jermář, 6 years ago

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.

by Jakub Jermář, 6 years ago

Attachment: stats1 added

by Jakub Jermář, 6 years ago

Attachment: stats40 added

comment:2 by Jakub Jermář, 6 years ago

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.

by Jakub Jermář, 6 years ago

Attachment: kmem-before added

by Jakub Jermář, 6 years ago

Attachment: kmem-after added

comment:3 by Jakub Jermář, 6 years ago

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 by Jakub Jermář, 6 years ago

Resolution: fixed
Status: newclosed

comment:5 by Jakub Jermář, 6 years ago

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