Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:26:36+00:00 2026-06-03T13:26:36+00:00

I am struggling to understand a possible memory leak in my code. I have

  • 0

I am struggling to understand a possible memory leak in my code. I have a simple web service that receives XML formatted messages and writes them to a database. I have noticed that after processing approximately 500K messages the application dies with an out of memory error. After a steep learning curve I managed to profile the running application and found very quickly that a web service implementation object was being held on the heap for each invocation of the service. To reduce the possibility that my code was the cause I modified the implementation so that it returned after doing nothing. However, the heap continued to grow. My environment, is Glassfish 3, CXF 2.4.2 and Eclipse (dynamic web project). I have included the service and implementation classes below. To try to be a bit clearer – after processing 500,000 messages there are 500,000 HL7ServiceImpl on the heap.

I am really at a loss with this so any assistance would be appreciated.

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService(name = "HL7Service", targetNamespace = "http://ws.foo.bar.com/")
public interface HL7Service {
    @WebMethod(operationName = "submit", action = "urn:Submit")
    public void submit(@WebParam(name = "msg") String msg);
}
import javax.jws.WebService;

@WebService(targetNamespace = "http://ws.foo.bar.com/", endpointInterface = "com.bar.foo.ws.HL7Service", portName = "HL7ServiceImplPort", serviceName = "HL7ServiceImplService")
public class HL7ServiceImpl implements HL7Service {
    public void submit (String msg) {

    //  if (msg == null)
    //      return ("NAK"); 
    //  else
    //      EventQueue.getInstance().submit(msg);
    //    
    //  return "ACK";

        if (msg != null) { // temp
            // DO nothing
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
        <jaxws:endpoint id="hl7service"
        implementor="com.bar.foo.ws.HL7ServiceImpl" address="/hl7service">
        <jaxws:features>
            <bean class="org.apache.cxf.feature.LoggingFeature" />
        </jaxws:features>
    </jaxws:endpoint>
</beans>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:26:37+00:00Added an answer on June 3, 2026 at 1:26 pm

    Ok, just in case someone else finds this question. The issue seemed to be related to a conflict between Glassfish’s native Metro implementation and CXF. Moving from CXF to Metro solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code snippet am struggling to understand. char *c; // c is
I have been struggling to understand some pieces of this code. It asks to
I am struggling to understand this simple regular expression. I have the following attempt:
I'm struggling to understand Dependency Properties in Silverlight 2. Does anybody have a good
I am really struggling to understand why, when I change my code to use
Hi guys I was looking at this code but I'm struggling to understand what
I'm currently struggling to understand how I should organize/structure a class which I have
I am struggling to understand on java threads work so excuse this rather simple
Really struggling to understand this problem, any ideas are welcome I have a carousel
I'm struggling to understand why the following code is echoing out 'FOO2' when i'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.