[llvm-bugs] [Bug 38727] clang-format consumes all available memory formatting Doug Lea`s malloc

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 3 12:48:53 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=38727

Vlad Bespalov <vlad.bespalov at jetstreamsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Vlad Bespalov <vlad.bespalov at jetstreamsoft.com> ---
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190403/91a60f40/attachment.html>


More information about the llvm-bugs mailing list