Unable to create native threads after creating 2700 threads [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
In my application I need to make use of multiple threads to make it work faster but I have been facing a situation where it says that unable to create native threads.
I have read that it is the RAM which decides the number of the threads a program can have which depends on the number of threads*stack size for each thread.
How do we know the stack size for a thread in Java? Can I decide stack size for thread on my own?

The number of native threads you can create depends on the OS. It's rather the OS that stops you from going to such a huge number, not the memory size.

Related

Analysing a Thread dump using java [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have a thread dump. Now, I want to know how many threads are running, what is their run time, what is its current state.
I don't want to use third party tools. I need a java code which takes dump file as input and shows the o/p.The main purpose is to find how long the threads were waiting.I want to find the threads with longest wait time!!
Use jvisualvm.It comes with your JDK.

How to read huge file and write on a file in java using Horizontal or Vertical Scaling [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Recently i was asked in an interview , how to read huge file (single file of 1TB) in java.I said by using Threading , we will create two File objects and one thread will read it from the beginning and other Thread will read from last. May be this is Stupid answer.And the Interviewer gave hint , by using Horizontal/Vertical Scaling , Clustering.
I have seen in Google there is no Example for Horizontal/Vertical Scaling , Clustering and reading files.can anyone help
This interview question is quite open; it tries to have you talk and think out loud. There will be many answers.
My personal interpretation:
Both scaling do not refer to classes or frameworks. They are concepts in architectures. Start with wikipedia if you are not clear on that.
Vertical scaling: here they probably want you to see how you can improve performance on a single host to get this huge file job done. This involves better disks, raid, multithreading of course. If any CPU/memory is heavily loaded, perhaps having more cpu and memory.
Horizontal scaling: this is usually about how to divide the problem across multiple jvm hosts to have the file processed concurrently, in a divide and conquer, scatter/gather pattern.

How can create an isolated JVM? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
How can I create JVM with fewer cpu and ram (resources) and give other access to it, while also ensuring that they cannot manipulate or view files or data of my system?
I want to create a web interface java compiler which everyone can use and would not like if other can manipulate my system.
If you use VirtualBox or another VM you can
choose the OS, it doesn't have to be the same.
choose all the files it can see
choose how much CPUs and memory it can use.
make it hard to break out of the virtual host and into the real host.

Jetty JVM is freezing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have 2 Jetty servers with the same problem,
The Jetty web app gets "freeze" every couple of hours.
(Freeze means that the console is not doing anything/unable to receive new requests)
During the "Freeze" I noticed that the JVM is using more swap than it usually does.
It seems like sort of a memory leak, even tough the system has enough memory.
I run the JVM with those run parameters:
-Xms8000m -Xmx280000m
Those are the RAM graphs (blank lines are what I called "freeze"):
See reference number 1 below
I also noticed the the garbage collector is not running very frequent.
Maybe it is related?
See reference number 2 below
I'd appreciate any input regarding a proper use of the garbage collector and any other ideas that would help resolve it
This is a spring/Hibernate based Application.
http://i.stack.imgur.com/VGOkM.jpg
http://i.stack.imgur.com/eI1mt.jpg

Get the windows LogOff Time? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to get the windows shutdown/logoff time by using java.I had tried
Runtime.getRuntime().addShutdownHook(new Message());
I ran this code,I didn't get shutdown time.
The JavaDoc is very clear of the method usage.
It says:
Registers a new virtual-machine shutdown hook.
That means the JVM, not the underlying OS.
You should consider C++ or reading the Windows event log for your requirement.

Categories