[llvm-bugs] [Bug 51843] New: Clang consumes 9GB of memory while parsing a TU with unknown type
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Sep 14 01:59:40 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=51843
Bug ID: 51843
Summary: Clang consumes 9GB of memory while parsing a TU with
unknown type
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: kadircetinkaya.06.tr at gmail.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
Contents of a.cc:
```
#include <random>
mt19937_6
char _pool[128 << 20];
```
Running `/usr/bin/time -v clang -fsyntax-only a.cc` results in:
```
Command exited with non-zero status 1
Command being timed: "clang -fsyntax-only a.cc"
User time (seconds): 1.55
System time (seconds): 2.40
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:03.95
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 9518328
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 13444
Voluntary context switches: 1
Involuntary context switches: 8
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 1
```
As can be seen maximum resident size is ~9GB. The same TU consumes only ~80MB
when the unknown type error is fixed.
--
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/20210914/9d35731c/attachment.html>
More information about the llvm-bugs
mailing list