Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 8 years ago

Last modified 8 years ago

#592 closed defect

tcp keeps creating new memory areas — at Initial Version

Reported by: Jiri Svoboda Owned by: Jakub Jermář
Priority: major Milestone: 0.6.0
Component: helenos/lib/c Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

tcp has quite a few memory areas and a few (1-10) are created every time websrv serves a file. The number of new memory areas does not appear to depend on the size of the file. It looks more like this happens per connection.

Some of the new areas have 1 MB (220 B) size, others have 8kB size (this is on ia32).

As far as I know TCP does not leak heap blocks anymore. Note that for each connection we create two fibril timers (and thus two fibrils) and destroy the, when the connection is terminated. So this might be an issue with malloc() and/or with fibril stack allocation.

After I serve /index.html a few times, taskdump on tcp gives:

Task Dump Utility
Dumping task 'tcp' (task ID 32).
failed opening file
Loaded symbol table from /srv/tcp

Threads:
 [1] hash: 0x8757a000
Thread 0x8757a000: PC = 0x00022899 (ra+0). FP = 0x00132f0c
  0x00132f0c: 0x00022899 (ra+0)
  0x00132f58: 0x00740650 (loc_callback_created+7406484)
  0x00132fd8: 0x000179a1 (async_manager_fibril+161)
  0x00132ff8: 0x0000afd9 (fibril_main+25)

Address space areas:
 [1] flags: R-XC base: 0x00001000 size: 188416
 [2] flags: RW-C base: 0x0002f000 size: 8192
 [3] flags: RW-C base: 0x00031000 size: 4096
 [4] flags: RW-C base: 0x00033000 size: 1048576
 [5] flags: RW-C base: 0x00134000 size: 16384
 [6] flags: RW-C base: 0x00139000 size: 1048576
 [7] flags: RW-C base: 0x0023a000 size: 1048576
 [8] flags: RW-C base: 0x0033b000 size: 1048576
 [9] flags: RW-C base: 0x0043c000 size: 1048576
 [10] flags: RW-C base: 0x0053d000 size: 1048576
 [11] flags: RW-C base: 0x0063e000 size: 1048576
 [12] flags: RW-C base: 0x0073f000 size: 8192
 [13] flags: RW-C base: 0x00742000 size: 1048576
 [14] flags: RW-C base: 0x00843000 size: 1048576
 [15] flags: RW-C base: 0x00944000 size: 16384
 [16] flags: RW-C base: 0x00949000 size: 1048576
 [17] flags: RW-C base: 0x00a4a000 size: 1048576
 [18] flags: RW-C base: 0x00b4b000 size: 8192
 [19] flags: RW-C base: 0x00b4e000 size: 1048576
 [20] flags: RW-C base: 0x00c4f000 size: 1048576
 [21] flags: RW-C base: 0x00d50000 size: 16384
 [22] flags: RW-C base: 0x00d55000 size: 1048576
 [23] flags: RW-C base: 0x00e56000 size: 1048576
 [24] flags: RW-C base: 0x00f57000 size: 8192
 [25] flags: RW-C base: 0x00f5a000 size: 1048576
 [26] flags: RW-C base: 0x0105b000 size: 1048576
 [27] flags: RW-C base: 0x0115c000 size: 1048576
 [28] flags: RW-C base: 0x0125d000 size: 1048576
 [29] flags: RW-C base: 0x0135e000 size: 16384
 [30] flags: RW-C base: 0x01363000 size: 1048576
 [31] flags: RW-C base: 0x01464000 size: 1048576
 [32] flags: RW-C base: 0x01565000 size: 8192
 [33] flags: RW-C base: 0x01568000 size: 1048576
 [34] flags: RW-C base: 0x01669000 size: 1048576
 [35] flags: RW-C base: 0x0176a000 size: 16384
 [36] flags: RW-C base: 0x0176f000 size: 1048576
 [37] flags: R--C base: 0x01870000 size: 4096
 [38] flags: RW-C base: 0x01874000 size: 1048576
 [39] flags: RW-C base: 0x01975000 size: 8192
 [40] flags: RW-C base: 0x01978000 size: 1048576
 [41] flags: RW-C base: 0x01a79000 size: 1048576
 [42] flags: RW-C base: 0x01b7a000 size: 16384
 [43] flags: RW-C base: 0x01b7f000 size: 1048576
 [44] flags: RW-C base: 0x01c80000 size: 1048576
 [45] flags: RW-C base: 0x01d81000 size: 8192
 [46] flags: RW-C base: 0x01d84000 size: 1048576
 [47] flags: RW-C base: 0x01e85000 size: 8192
 [48] flags: RW-C base: 0x01e88000 size: 1048576
 [49] flags: RW-C base: 0x01f89000 size: 8192
 [50] flags: RW-C base: 0x01f8c000 size: 1048576
 [51] flags: RW-C base: 0x0208d000 size: 8192
 [52] flags: RW-C base: 0x02090000 size: 1048576
 [53] flags: RW-C base: 0x02191000 size: 8192
 [54] flags: RW-C base: 0x02194000 size: 1048576
 [55] flags: RW-C base: 0x02295000 size: 8192
 [56] flags: RW-C base: 0x02298000 size: 1048576
 [57] flags: RW-C base: 0x02399000 size: 8192
 [58] flags: RW-C base: 0x0239c000 size: 1048576
 [59] flags: R-XC base: 0x70001000 size: 135168
 [60] flags: RW-C base: 0x70022000 size: 4096
 [61] flags: RW-C base: 0x70023000 size: 4096
 [62] flags: RW-C base: 0x70025000 size: 1048576
 [63] flags: RW-C base: 0x70126000 size: 1048576
 [64] flags: RW-C base: 0x7ff00000 size: 1048576

jirka@omelette:/tmp> 

Prehaps the most noticeable impact is that dumping core takes a loong time because the core file becomes huge.

Change History (0)

Note: See TracTickets for help on using tickets.