stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Dean" <Jeremy.D...@roguewave.com>
Subject Problem with Memory with strings on HP-IPF
Date Fri, 30 Nov 2007 21:29:06 GMT
I have a customer that is working on HP-IPF with the SourcePro edition 9
release of the Standard Library.  He is noticing quite a bit of memory
growth on the HP IPF versus the HP pa-risc platforms.  I was wondering
if anyone has run into this problem.
 
Here is a sample test case provided by the customer:
 
#include <stdio.h>
#include <stdlib.h>
#include <string>
 

void print_mallinfo()
{
        struct mallinfo info;
        info = mallinfo();
        printf("Memory allocation info:\n");
        printf(" total space in arena = %d\n", info.arena);
        printf(" number of ordinary blocks = %d\n", info.ordblks);
        printf(" number of small blocks = %d\n", info.smblks);
        printf(" space in holding block headers = %d\n", info.hblkhd);
        printf(" number of holding blocks = %d\n", info.hblks);
        printf(" space in small blocks in use = %d\n", info.usmblks);
        printf(" space in free small blocks = %d\n", info.fsmblks);
        printf(" space in ordinary blocks in use = %d\n",
info.uordblks);
        printf(" space in free ordinary blocks = %d\n", info.fordblks);
        printf(" keep option space penalty = %d\n", info.keepcost);
        printf(" space in use = %d\n", info.usmblks + info.uordblks);
        printf(" space free = %d\n", info.fsmblks + info.fordblks); }
 
main(int argc, char **argv)
{
        for (int ix=0; ix<2; ix++)
        {
            std::string *p = new std::string("A");
            print_mallinfo();
        }
        return 0;
}
 
On a HP-paRisc machine the output is as follows:
 
Memory allocation info:
 total space in arena = 106444
 number of ordinary blocks = 141
 number of small blocks = 200
 space in holding block headers = 1832
 number of holding blocks = 2
 space in small blocks in use = 80
 space in free small blocks = 7920
 space in ordinary blocks in use = 21928
 space in free ordinary blocks = 74672
 keep option space penalty = 0
 space in use = 22008
 space free = 82592
Memory allocation info:
 total space in arena = 106444
 number of ordinary blocks = 142
 number of small blocks = 200
 space in holding block headers = 1832
 number of holding blocks = 2
 space in small blocks in use = 160
 space in free small blocks = 7840
 space in ordinary blocks in use = 30152
 space in free ordinary blocks = 66448
 keep option space penalty = 0
 space in use = 30312
 space free = 74288
 
I am still working on trying to get the IPF results.
 
Jeremy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message