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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:19:47+00:00 2026-05-23T08:19:47+00:00

Searching memcached java in google, the first result is Using Memcached with Java .

  • 0

Searching memcached java in google, the first result is Using Memcached with Java.

The guy (who calls himself Just some Random Asshole in the Internet!) proposes a Singleton based on net.spy.memcached. It basically creates 20 threads and connections by creating 20 instances of MemcachedClient. For every request it chooses one at random.

However those threads and connections are never closed and they pile up every time I hot swap the application during development (with warnings from Tomcat 7).

SEVERE: The web application [/MyAppName] appears to have started a thread named
[...] but has failed to stop it. This is very likely to create a memory leak.

By looking at MemcachedClient JavaDoc, I see a method called shutdown with the only description being “Shut down immediately.” Shut down what? The client? The server? I suppose is the client, since it’s in MemcachedClient and I suppose that this method would close the connection and terminate the thread. EDIT: yes, it shuts down the client.

Question 1 How to force the execution of cleanup code in Tomcat 7, before the application is hot swapped?

Question 2 Is this approach of using memcached (with cleanup code), correct or is better I start over in a different way?

  • 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-23T08:19:48+00:00Added an answer on May 23, 2026 at 8:19 am

    It turned out that it was a bug of Java AWS SDK and was not related to memcached. Version 1.2.2 of Java AWS SDK has this bug fixed.

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

Sidebar

Related Questions

Searching on Google reveals x2 code snippets. The first result is to this code
Searching from google.com, like www.abc.com Search Result Rank the pages like Title..... Description... www.abc.com
Searching Stackoverflow on Google I get this result: Inspecting the HTML source of the
Some searching through Google (and my own experience) shows that in PHP you can't
Searching for some telnet or SSH libraries (C#) to using with Windows Phone 7.
Searching for some sample code for converting a point in WGS84 coordinate system to
Im searching a tool which allows me to specify some folders as bookmarks and
I'd been searching for a way to do cookie based authentication/sessions in Google App
Searching for a simple first-child detection via javascript (no framework). It should add class
Searching for a way to add this code, after the <head> (or some <link

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.