Most answers for [java] and [jvm]

Architect for Chronicle Software http://chronicle.software

Blog has had 3 million hits http://vanillajava.blogspot.com

Java Champion

3h
comment NullPointerException with no stack trace
Once you have enough exceptions thrown at the same point, it drops the stack trace. You need to look at the start of your log. (Or you can use a debugger to breakpoint which this Exception occurs)
3h
comment Socket Exception: Peer crashing vs. socket is closed (locally or remotely)
For a graceful close I send a poison pill message and have the other end close the connection.
4h
comment Is varargs of array possible in Java?
You are creating a new Object[] which cannot be cast to a String[]
6h
comment Java clone null pointer exception?
The problem is; the object instance you are trying to use doesn't exist, so there is no fear of it being changed.
6h
comment Java clone null pointer exception?
You can't call clone (or any method) on an object which doesn't exist, nor can you override a method on a class which doesn't exist.
6h
comment Java clone null pointer exception?
How/why would you want "Set is extended from an ArrayList"
7h
comment How to debug ArrayIndexOutOfBoundsException in Java?
Empty strings are not null. You can check if (splitSentence.length >= 3)
8h
comment How to debug ArrayIndexOutOfBoundsException in Java?
Assuming you have 2 : in your string, you will have index 0, 1, 2. However if you have a blank line, say at the end, this will blow up.
8h
comment How to debug ArrayIndexOutOfBoundsException in Java?
Possible duplicate of How do I compare strings in Java?
8h
comment How to debug ArrayIndexOutOfBoundsException in Java?
If you step through the code in your debugger you can see that you are trying to use an index of an array which doesn't exist.
9h
comment What measures should I take before inserting one million records to database at one time?
You should consider testing it and seeing what happens. Almost certainly it will do something no-one can predict for you use case.
9h
comment I want to make SQL queries in YML/YAML file(s), using JAVA. Is there any JDBC driver for that?
Yes, there is a way of doing that, but you need to be clearer as to what you are trying to achieve and what is stopping you from doing it now.
12h
comment Is there any existing programming language identical to Java, but without the trivial defects?
Have a look at kotlinlang.org which is largely syntactic sugar over what Java does for the JVM. esp if you are using IntelliJ already.
12h
comment OrientDB Update runs into JVM memory issue 'Cannot allocate memory'
What sort of device are you running this on? A Raspberry Pi? Most mobile phones have more memory than this.
12h
comment i need a suggestion which open source webrtc framework or library is better to use with java for real time communication
This site if not for giving recommendations. If you know the pros and cons, only you can say which is best for your projects as only you know it best.
12h
comment How to write java program that simulates a "pseudo" MACHINE LEARNING program?
What have you tried and what are you having trouble with? This site is to help you solve problems in your code, not do research or the program for you.
12h
comment Stack/Heap in JVM
The JVM is still a C program running in an operating system. The only difference is that the JVM has a managed heap which is a continuous region managed by the JVM inside the C heap. The thread stacks are still the stacks, the code area is still the same. etc.
12h
comment Why does the parallel stream not use all the threads of the ForkJoinPool?
You need enough thread to keep all your CPU busy, most than this and you are likely to be adding overhead and run slower.
12h
comment How to round down a decimal to integer
@digeridoo it can be amazing what you can discover when you try the first code you can think of ;)
12h
comment JVM memory usage keep on increasing
@Shame I would start with the memory profiling tools which are built into the JVM.
1 2 3 4 5