> How long have you been having the memory issues with your app?
> I have not yet tested a build with recent cvs (last time was 
> cvs from last October), but over the last several
> years we have watched this issue and have NOT had any memory
> leaks that were not fixed here on this list.

The problem has always existed not in any specific CVS


> We have a FWH app with MDI child windows, and we cycle through
> opening and closing all 8 types of mdi children, plus opening
> modal dialogs in an automated test using what was MSTEST.

Our MDI has the next estructure

        MDICHILD (NO RESOURCE)
                 BUTTONBAR
                TFOLDER (NO RESOURCE)
                        DIALOGS FROM RESOURCES                  
                MSGBAR

Is important the use of resources to see the problem.

we change this method in MSGBAR to find the problem

METHOD TimerEval() CLASS TMsgBar

    local n, oItem, cBits
    LOCAL aMemory, oBrw // MAM
    STATIC oDlg   // MAM

    for n = 1 to Len( ::aItem )
       oItem = ::aItem[ n ]
       if oItem:lTimer
          oItem:Refresh()
       endif
    next

    #ifdef __CLIPPER__
       cBits = "(16 bits) "
    #else
       cBits = "(32 bits) "
    #endif

    if ::lCheckRes
       /* MAM
       ::oWnd:SetText( cBits + ;
                       "MemUsed: " + AllTrim( Transform( MemUsed(), 
"999,999,999,999" ) ) + ;
                       " MemMax: " + Alltrim( Transform( MemMax(), 
"999,999,999,999" ) ) + ;
                       " Resources: " + AllTrim( Str( GetFreeSystemResources( 1 
) ) ) + "%" + ;
                       " Running time: " + TimeFromStart() )
       */

       IF Empty( oDlg )
          DEFINE DIALOG oDlg TITLE 'Estadística de uso de la memoria' FROM 
20,20 TO 17,50

          aMemory := {|m| m := GlobalMemoryStatus(),;
           {{ 'Memoria en uso',                        cValToChar( m[1] ) + '%' 
},;
            { 'Espacio libre para variables',          cBytesToMultiple( 
Memory( 0 ) * 1024 ) },;
            { 'Cadena más larga',                      cBytesToMultiple( 
Memory( 1 ) * 1024 ) },;
            { 'Memoria física',                        cBytesToMultiple( 
Memory( 2 ) * 1024 ) + ' de ' + cBytesToMultiple( m[2] 
) },;
            { 'Memoria Virtual',                       cBytesToMultiple( 
Memory( 3 ) * 1024 ) + ' de ' + cBytesToMultiple( m[6] 
) },;
            { 'Segmentos en memoria/Heap fijada',      Transform( Memory( 102 
), '@E 999,999,999' ) },;
            { 'Memoria Swap libre',                    cBytesToMultiple( 
Memory( 103 ) * 1024 ) },;
            { 'Memoria usada',                         cBytesToMultiple( 
Memory( 1001 ) ) },;
            { 'Máximo memoria usada',                  cBytesToMultiple( 
Memory( 1002 ) ) },;
            { 'Total items en la pila',                Transform( Memory( 1003 
), '@E 999,999,999' ) },;
            { 'Total de memoria usada por la pila',    cBytesToMultiple( 
Memory( 1004 ) ) },;
            { 'Total de items actualmente en la pila', Transform( Memory( 1005 
), '@E 999,999,999' ) },;
            { 'Tiempo en ejecución',                   TimeFromStart() } } }

          TWBrowse():lHScroll := .F.
          TWBrowse():lVScroll := .F.
          @  0, 0 LISTBOX oBrw FIELDS OF oDlg UPDATE
          oDlg:oClient := oBrw
          WITH OBJECT oBrw
             :SetArray( Eval( aMemory ) )
             :lCellStyle := .T.
             :nLineStyle := 4 // LINES_DOTED
             :nClrText   := CLR_BLACK
             :aColSizes  := {110,70}
             :aJustify   := {0,1}
             :aHeaders   := {"Memoria", "valor"}
             :bLine      := {|a| a := Eval( aMemory ),;
                                 { a[oBrw:nAt, 1 ], a[oBrw:nAt, 2 ] } }
          END WITH

          oDlg:bValid := {|| ::lCheckRes := .F., .T. }
          ACTIVATE DIALOG oDlg NOWAIT;
             ON INIT ( oDlg:SetSize( 400, nMinWndHeight( oDlg ) +;
                                          ( 13 * ( oBrw:nLineHeight + 1) ) + 
oBrw:nHeaderHeight + 1 ),;
                       oDlg:Resize() )
          oDlg:GoTop()
       ELSE
          oDlg:Update()
       ENDIF
       // MAM End
    else
       // MAM
       IF ! Empty( oDlg )
          oDlg:End()
          oDlg := Nil
       ENDIF
       /*
       if ! Empty( ::Cargo )
          ::oWnd:SetText( ::Cargo )
          ::Cargo = nil
       endif
       */
       // MAM End
    endif

return nil


HB_FUNC( GLOBALMEMORYSTATUS )
{
     MEMORYSTATUS state;
     PHB_ITEM pList = hb_itemArrayNew( 0 );
     PHB_ITEM pItem = hb_itemNew( NULL );

     state.dwLength = sizeof (state);

     GlobalMemoryStatus( &state );

     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwMemoryLoad ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwTotalPhys ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwAvailPhys ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwTotalPageFile ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwAvailPageFile ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwTotalVirtual ) );
     hb_arrayAdd( pList, hb_itemPutNLL( pItem, state.dwAvailVirtual ) );

     hb_itemRelease( pItem );
     hb_itemRelease( hb_itemReturnForward( pList ) );
     return;
}


> So if you had this problem for a long time, I don't think
> it's FWH (although we do have altered versions of the Window
> classes, we stay close to Antonio's code).
> 
> Get back to me on private email about this, and we'll compare
> approaches.  Meanwhile I'll run the test on the current cvs
> build and see what's happening.
> 

you can contact with me at messenger [EMAIL PROTECTED]

Best regards,
Miguel Angel Marchuet

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to