public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "matt at use dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54307] New: [4.7 regression] increases in memory usage by some C++11 (and C++03) standard containers Date: Fri, 17 Aug 2012 21:43:00 -0000 [thread overview] Message-ID: <bug-54307-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54307 Bug #: 54307 Summary: [4.7 regression] increases in memory usage by some C++11 (and C++03) standard containers Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: matt@use.net Between 4.6 and 4.7.x, the memory used by a few standard containers has increased, resulting in some OOM and performance issues on an amd64 application I work on. 4.7: list<int> size = 24 unordered_map<int,int> size = 64 unordered_set<int,int> size = 64 4.6: list<int> size = 16 unordered_map<int,int> size = 56 unordered_set<int,int> size = 56 comparing to VC11: list<int> size = 16 unordered_map<int,int> size = 64 unordered_set<int,int> size = 64 compile commandline is just -std=c++0x. testcase program below: #include <vector> #include <array> #include <deque> #include <forward_list> #include <list> #include <queue> #include <stack> #include <tuple> #include <map> #include <set> #include <hash_map> #include <hash_set> #include <unordered_map> #include <unordered_set> #include <string> using namespace std; int main(void) { vector<int> v; printf("vector<int> size\t = %d\n", sizeof(v)); array<int,5> a; printf("array<int,5> size\t = %d\n", sizeof(a)); deque<int> d; printf("deque<int> size\t = %d\n", sizeof(d)); forward_list<int> f; printf("forward_list<int> size\t = %d\n", sizeof(f)); list<int> l; printf("list<int> size\t = %d\n", sizeof(l)); queue<int> q; printf("queue<int> size\t = %d\n", sizeof(q)); stack<int> s; printf("stack<int> size\t = %d\n", sizeof(s)); tuple<int,int,int> t; printf("tuple<int,int,int> size\t = %d\n", sizeof(t)); map<int,int> m; printf("map<int,int> size\t = %d\n", sizeof(m)); set<int> set; printf("set<int> size\t = %d\n", sizeof(set)); unordered_map<int,int> um; printf("unordered_map<int,int> size\t = %d\n", sizeof(um)); unordered_set<int> us; printf("unordered_set<int,int> size\t = %d\n", sizeof(us)); string str; printf("string size\t = %d\n", sizeof(string)); return 0; }
next reply other threads:[~2012-08-17 21:43 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-08-17 21:43 matt at use dot net [this message] 2012-08-17 22:59 ` [Bug libstdc++/54307] " hjl.tools at gmail dot com 2012-08-18 0:05 ` paolo.carlini at oracle dot com 2012-08-21 17:27 ` matt at use dot net 2012-08-21 17:35 ` paolo.carlini at oracle dot com 2012-09-07 10:35 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-54307-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).