cancel
Showing results for 
Search instead for 
Did you mean: 

Open reference for QueryResult

itayh
Champ in-the-making
Champ in-the-making
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
3 REPLIES 3

mark_smithson
Champ in-the-making
Champ in-the-making
I think there may be a close method on the QueryResult and/or the ResultSet

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

No this is nothing I've noticed before.  The ResultSet object is a generated Axis stub, perhaps there is an issue with Axis.

It may be worth while logging this as an issue in Jira to ensure the fix is appropriatly prioritised. (http://issues.alfresco.com)

Cheers,
Roy

itayh
Champ in-the-making
Champ in-the-making
Hi,

Thx for your responses.
I notice that the memory get free after 60 seconds.
Maybe it is related to 60 seconds timeout in RepositoryServiceSoapBindingStub?

Thx,
  Itay