<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:vlad.bespalov@jetstreamsoft.com" title="Vlad Bespalov <vlad.bespalov@jetstreamsoft.com>"> <span class="fn">Vlad Bespalov</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang-format consumes all available memory formatting Doug Lea`s malloc"
href="https://bugs.llvm.org/show_bug.cgi?id=38727">bug 38727</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang-format consumes all available memory formatting Doug Lea`s malloc"
href="https://bugs.llvm.org/show_bug.cgi?id=38727#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang-format consumes all available memory formatting Doug Lea`s malloc"
href="https://bugs.llvm.org/show_bug.cgi?id=38727">bug 38727</a>
from <span class="vcard"><a class="email" href="mailto:vlad.bespalov@jetstreamsoft.com" title="Vlad Bespalov <vlad.bespalov@jetstreamsoft.com>"> <span class="fn">Vlad Bespalov</span></a>
</span></b>
<pre>Reran with looser memory limitations (8G) and with new clang (8.0.0)
Appears the problem was fixed in 7.0.0, but still parsing the file requires ~5G
of memory:
-------------------
$ ulimit -v -m
virtual memory (kbytes, -v) 8000000
max memory size (kbytes, -m) 8000000
-------------------------
$ clang-format --version
clang-format version 8.0.0 (tags/RELEASE_800/final)
$ /usr/bin/time -v clang-format malloc.c
Command being timed: "clang-format malloc.c"
User time (seconds): 107.33
System time (seconds): 3.86
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:51.58
...
Maximum resident set size (kbytes): 4819432
...
Minor (reclaiming a frame) page faults: 3604088
...
Exit status: 0
-----------------------
$ ./clang-format --version
clang-format version 7.0.1 (tags/RELEASE_701/final)
$ /usr/bin/time -v ./clang-format malloc.c
Command being timed: "./clang-format malloc.c"
User time (seconds): 137.45
System time (seconds): 3.79
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:21.64
...
Maximum resident set size (kbytes): 4809384
...
Minor (reclaiming a frame) page faults: 3597697
...
Exit status: 0
-----------------------
Clang 6.0.1 still fails with std::bad_alloc under these constraints.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>