J
jithoosin
Hi
I am using STL in my code. So after some time it appears as if the
code is leaking memory. I did a memory profiling using valgrind massif
to find out that most memory in my code is allocated using the 2
functions
1) std::__default_alloc_template<true, 0>::allocate(unsigned) (in
/usr/lib/libstdc++.so.5.0.3)
2) std::__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned,
int&) (in /usr/lib/libstdc++.so.5.0.3)
When i googled i found a useful reference:
http://www-1.ibm.com/support/docview.wss?rs=994&context=SSSHAD&dc=DB5...
It asks me to use __malloc_alloc_template<0> in my code so that STL
"actualy frees" memory. So I have 3 questions .
1) Would this strategy be helpful ?
2) Is there any easy way to make my code use this template by any
options rather than changing the code as the link suggests ?
3) How this allocator can be used with a map ?
Thanks in advance.
Regards
Kiran Pradeep
I am using STL in my code. So after some time it appears as if the
code is leaking memory. I did a memory profiling using valgrind massif
to find out that most memory in my code is allocated using the 2
functions
1) std::__default_alloc_template<true, 0>::allocate(unsigned) (in
/usr/lib/libstdc++.so.5.0.3)
2) std::__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned,
int&) (in /usr/lib/libstdc++.so.5.0.3)
When i googled i found a useful reference:
http://www-1.ibm.com/support/docview.wss?rs=994&context=SSSHAD&dc=DB5...
It asks me to use __malloc_alloc_template<0> in my code so that STL
"actualy frees" memory. So I have 3 questions .
1) Would this strategy be helpful ?
2) Is there any easy way to make my code use this template by any
options rather than changing the code as the link suggests ?
3) How this allocator can be used with a map ?
Thanks in advance.
Regards
Kiran Pradeep