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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:35:41+00:00 2026-05-16T08:35:41+00:00

i saw comment like this one place i have seen this problem is if

  • 0

i saw comment like this

one place i have seen this problem is if you keep creating threads, and instead of calling start(), call run() directly on the thread object.
This will result in the thread object not getting dereferenced…
So after sometime the message unable to create new native thread comes up

on the Sun Java Forums

In my application, initialy we plan to use thread, but later, we decided no need anymore, so we just call run() instead of start(). Do we need to do manual GC for new threadClass(..) ?

my tomcat startup setting

-Xms1024m -Xmx1024m -XX:MaxPermSize=450m 
  • 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-16T08:35:41+00:00Added an answer on May 16, 2026 at 8:35 am

    Why do you create a Thread in the first place?

    Your code should implement the Runnable interface instead.

    Then, when you decide that you want to run it in a thread, simple instantiate a Thread with the Runnable as the argument and call start() on the Thread object.

    If, instead, you just want to run it in your current thread, simply call run() on your Runnable object.

    This has several advantages:

    • you don’t involve any Thread objects as long as you don’t care about separate threads
    • your code is wrapped in a Runnable which fits closer conceptually: you’re not writing some special kind of Thread, do you? You simply write some code that can be executed/run.
    • you can easily switch to using an Executor which further abstract away the decision

    And last but not least you avoid any potential confusion on whether or not a native thread resource is created.

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

Sidebar

Related Questions

I saw many threads with this tittle, but no one really speak about reuse
I saw comment If you have 50 million values between 10 and 15 characters
just saw this comment in a what JS lib do you use poll @Xanti
I was reading a forum recently, and saw this comment: So, you see you've
I just saw the first comment to this question Inserting into a serialized array
I've made a voting on comments like the one this website has(something similar), and
So I saw this question/comment... How to integrate SQL Server 2005 Express Edition to
So in a comment from another question , I just saw this example for
I saw a comment on Ben Nadel's blog where Stephen Rushing posted a loader,
I query my mySql database table and retrieve text strings that look like this:

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.