AnsweredAssumed Answered

Open reference for QueryResult

Question asked by itayh on Aug 5, 2007
Latest reply on Aug 7, 2007 by itayh
Hi,

I am using web services API in the next code
// Execute the query to get all devies
        QueryResult queryResult = repositoryService.query( ClientConstants.STORE, devicesQuery, true);    
      
        // Display the results
        ResultSet resultSet = queryResult.getResultSet();
        ResultSetRow[] rows = resultSet.getRows();
        if (rows == null)
        {
            logger.error( "No Devices found!!! Can it be ??");
        }
        else
        {                            
            for ( int i = 0; i < rows.length; i++)
            {
                h = General.getStringQueryResults( rows);
               
               String deviceId = h.get( ClientConstants.DEVICE_ID);
               
               if ( deviceId == null || deviceId.equals( ClientConstants.STR_EMPTY))
                  continue;
               
              String[] devicesParameters = new String[2];
                            
                //first place is for default devie name
                devicesParameters[0] = new String( h.get( ClientConstants.DEFAULT_DEVICE));
               
                //second place fo user agent
                devicesParameters[1] = new String( h.get( ClientConstants.USER_AGENT));
                                   
                tmpDevices.put( deviceId, devicesParameters);   
                logger.debug( "Device Loaded. Device Id=" + deviceId + ", default device=" + devicesParameters[0] + ", user agent=" + devicesParameters[1]);
            }//for             
        }//if-else

I get the response and fill my objects. I have no reference in my code  for the response object that I got from alfresco but the memory does not get released (not even after System.gc() direct call). This cause our program to use too much memory. Does any one face this issue before? Do I need to release it some how?

Thx alot,
Itay

Outcomes