StaticPL/JAVA
-
Garbage Collection (GC)StaticPL/JAVA 2019. 8. 23. 06:51
1. Overview Since Java oriented programs don't deallocate memory explicitly, Garbage collection tracks each and every object available in the JVM space and removes unused ones. GC works in two simple steps known as Mark and Sweep. 2. Minor GC Collecting garbage from Young space (consisting of Eden and Survivor spaces) is called a Minor GC. This definition is both clear and uniformly understood. ..
-
JDK, JRI, JVM, and ClassloaderStaticPL/JAVA 2019. 8. 23. 06:32
1. Overview The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development. 2. Java Development Kit (JDK) It is a kit that provides the environme..
-
CallableStaticPL/JAVA 2019. 8. 21. 22:39
1. Overview Whereas Runnable object can not return a result, Callable return a result and throw a checked exception in spite of being executed inside a thread likewise. 2. Description 2.1 Callable Callable interface has a single method call() which is meant to contain the code is executed by a thread. Callable callable = new Callable() { @Override public String call() throws Exception { // Perfo..
-
Executors Framework and Thread PoolsStaticPL/JAVA 2019. 8. 21. 20:39
1. Overview Naive Thread management by extending the Thread class or implementing the Runnable interface has a problem when an application requires creating 20 or 30 threads for running tasks concurrently. Executors Framework is creating and managing threads for a production-ready application like hundreds, if not thousands of threads running simultaneously. 2. Description 2.1 Executor Functiona..
-
CompletableFuture, and FutureStaticPL/JAVA 2019. 8. 20. 11:12
1. Overview CompletableFuture and Future are used for asynchronous programming in Java. Asynchronous programming is a means of writing non-blocking code by running a task on a separate thread than the main application thread and notifying the main thread about its progress, completion or failure. So Main thread doesn't block/wait for the completion of an async task and it can execute other tasks..
-
ThreadlocalStaticPL/JAVA 2019. 8. 19. 22:28
1. Overview Clarify what Threadlocal is and how and when to use it. 2. Introduction Threadlocal has the ability to store data individually for the current thread. Thus, even if multiple threads are executing the same code, and the code has a reference to a Threadlocal variable, there's no need to synchronize that variable because multiple threads cannot see each other's Threadlocal variables. 3...
-
Thread and RunnableStaticPL/JAVA 2019. 8. 18. 20:33
1. Overview Summarize Thread in JAVA. Thread class provides constructors and methods to create and perform operations on a thread. It is derived from Object class and implements the Runnable interface. Threads can be created by using two mechanisms : Extending the Thread class Implementing the Runnable Interface 2. The life cycle of Threads 2.1 NEW Thread instance newly created, have not started..
-
StreamStaticPL/JAVA 2019. 8. 18. 20:25
1. Overview Added from JAVA 8. A stream is a sequence of objects that supports various methods that can be pipelined to manipulate results. Stream operations are either intermediate or terminal. Intermediate operations return a stream so we can chain multiple intermediate operations without using semicolons. Terminal operations are either void or return a non-stream result. 2. Features Do not ch..