title: Declaring static method in Singleton spring bean
body: <p>We are running into memory leak issue and we suspect that below code could be reason, we have a static method in a singleton class and doubt that its causing memory leak while its being referenced directly.</p>
  
  <pre><code>// This class is wired in spring xml and loaded as spring bean
  public class SpringSingletonRestClient{
  
  // instance method to make a web-service call
  public ServiceResponse getResponseFromARestService(String RequestParam){.....}
  
  // public static helper bean mapping method, that is used outside this class 
  // for converting the service response object to different object
  public static DomainResponse convertServiceResponseToDomainResponse(ServiceResponse serviceResponse){ //conversion logic.... }
   }
  
  }
  </code></pre>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>Class MainClass {
  
  //injected as spring bean
  SpringSingletonRestClient client;
  
  public void someMethod(){
  ServiceResponse serviceResponse = client.getResponseFromARestService(...);
  DomainResponse domainResponse =  SpringSingletonRestClient.convertServiceResponseToDomainResponse(serviceResponse);
  // use domainResponse object
  .......
  .......
  }
  
  }
  </code></pre>
  
  <p>Please let me know if more clarification is required since I just added pseudo. 
  We are running to high memory usage and we suspect that using the static method which is declared in a class that is initiated by the spring is not garbage collected correctly and there is memory leak happening because of it.</p>
  
  <p>Question - Is it bad to have static methods in a Spring initiated singleton class even though that static method is used by direct reference and not used by its instance variable.</p>