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 7658697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:14:08+00:00 2026-05-31T13:14:08+00:00

I am working with socket application. I have a JAVA TCP listener as a

  • 0

I am working with socket application. I have a JAVA TCP listener as a part of web application. I have defined my TCP Listener as a servlet context listener inside web.xml, so once I start my tomcat my TCP listener become active and wait for incoming request coming from GPS device.

Once my tomcat6.0 starts then TCP listener is able to read all incoming request but, just after 5 minute, I get an error like this “The web application appears to have started a thread named but has failed to stop it. This is very likely to create a memory leak.”.

Please help me how to fix this issue. As I am creating simultaneously many threads to handle the incoming request since we have 10K GPS device which communicates with my TCP listener.
We have business reason to create a single thread for single device and process incoming request.

Please help me to figure out actual issue.

Thanks in advance.

  • 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-05-31T13:14:09+00:00Added an answer on May 31, 2026 at 1:14 pm

    I’ll assume that you’ve checked the JVM settings with which you start Tomcat. Maybe your memory is too low.

    I’d recommend that you download Visual VM 1.3.3, install all the plugins, start your Tomcat application, and attached Visual VM to the JVM. It’ll show you what’s happening in memory, CPU, objects created, threads, etc.

    You showed no code, and you have no data. You’ll never solve this problem this way. No one here can help you much, either. Your code is creating too many objects. You need to find out why and stop it.

    We have business reason to create a single thread for single device
    and process incoming request.

    You might have a business reason, but your technical reasons might not be sound. Each HTTP request that comes in has a single thread. Isn’t that what you want? When a GPS posts a request you have a single thread to handle it, right? Why must you create many threads with each request? What are those threads doing?

    Another approach might be to refrain from creating threads. When a request comes in from a device, find some unique tag like a device id and add that message to the session history for that device. I haven’t heard any justification for creating threads so far.

    I don’t know if you’re taken the trouble to write your own server, but I’d recommend that you look into using Netty. It’s an all-Java server based on non-blocking IO that’s born to handle high traffic. They know how to handle threads. Maybe you can just use it and add your processing logic to it.

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

Sidebar

Related Questions

I am working on a server application which receives data over a TCP socket
I have developed a Java socket server connection which is working fine. When started
I'm working on a live video Java application, and have run into the common
I'm working on a java applet/desktop application. It runs directly on the desktop, and
I have win32 application in which winsock is used for TCP/IP communication. I am
I have a Python server script and a Java client application and the goal
I have try to make chat application with socket programing and I am using
I am working on building a web-application using Django. Since I'm new to working
I have tomcat 6.0.32 installed and running my web application on it. Usual stop/start
I was working on a project which includes developing an application using java sockets.

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.