public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54307] New: [4.7 regression] increases in memory usage by some C++11 (and C++03) standard containers
@ 2012-08-17 21:43 matt at use dot net
  2012-08-17 22:59 ` [Bug libstdc++/54307] " hjl.tools at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: matt at use dot net @ 2012-08-17 21:43 UTC (permalink / raw)
  To: gcc-bugs

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;
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-07 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 21:43 [Bug libstdc++/54307] New: [4.7 regression] increases in memory usage by some C++11 (and C++03) standard containers matt at use dot net
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

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).