References in Java and JNI (strong, soft, weak, virtual)

1. Strong References (Objects) Features: Strong references provide direct access to the target object. Will not be recycled. Two, soft reference (SoftReference class) Features: When GC reclaims based on JVM memory, JVM reclaims when it finds it is out of memory Conditions for freeing up space: JVM found insufficient m ...

Posted on Sun, 19 Jul 2020 11:33:27 -0400 by amitkrathi

References in Java and JNI (strong, soft, weak, virtual)

1. Strong References (Objects) Features: Strong references provide direct access to the target object. Will not be recycled. Two, soft reference (SoftReference class) Features: When GC reclaims based on JVM memory, JVM reclaims when it finds it is out of memory Conditions for freeing up space: JVM found insufficient m ...

Posted on Sun, 19 Jul 2020 11:35:19 -0400 by Mikersson

Coexistence of Kotlin and Java, calling kotlin code in -Java

Call of kotlin data class Call of object simple profit mode class in Kotlin Calling file class in Kotlin Flexible transfer of parameters by calling jvm annotation String string null call Call of kotlin data class kotlin Code: package com.tianfu.kotlin /** * age Member annotations cannot have get and ...

Posted on Wed, 08 Jul 2020 12:02:49 -0400 by gareh

java foundation Object class

  catalog 1. getClass method 2. equals method 3. hashCode() method 4. toString method 5. clone method 6. Grammar sugar: automatic packing and unpacking The Object class is the root of all Java class inheritance systems. All Java classes, including arrays, inherit from the Object class. There ...

Posted on Sun, 28 Jun 2020 00:21:02 -0400 by jswinkelman

Some differences between Synchronized decorating method and code block at the bottom

Article catalog Decorated code block Modify instance method Modifying static methods summary Decorated code block The above example: public class SyncCodeBlock { public int i; public void syncTask(){ //Sync codebase synchronized (this){ i++; } } } Compile with j ...

Posted on Sat, 27 Jun 2020 02:14:36 -0400 by bobby4

[Java] basic knowledge for a java programmer

Article catalog Java Basics data type Basic types Packing type Cache pool String (string) overview Immutability of String: String, StringBuffer and StringBuilder String Pool operation Parameter passing keyword final static Methods in Object overview equals() hashCode() toString() clone() Thr ...

Posted on Fri, 26 Jun 2020 01:10:57 -0400 by steveonly20

Elasticsearch Series - Best Practices for Performance Tuning

outline Performance tuning is an essential topic for all components in the system architecture, and Elasticsearch is no exception. Although the default configuration in Elasticsearch is already excellent, it does not mean that it is perfect. Some of the necessary practices need to be understood. Open Slow Query Log Slow query log is an importan ...

Posted on Tue, 23 Jun 2020 19:58:56 -0400 by Ali25m

Day09+10 stream related content

Day09+Day10 1, IO IO represents Input and Output respectively. Data transmission needs to rely on flow, which can be understood as data flow. According to the direction of flow, it is divided into input stream (from device to memory) and output stream (from memory to device). According to the differ ...

Posted on Tue, 23 Jun 2020 05:54:04 -0400 by adksga

26 - how does the production environment exclude and optimize the JVM?

I believe you have a general impression on the theory and practice of the JVM through the previous several lessons. This lesson will focus on the troubleshooting and optimization of the JVM, so as to have a complete understanding of the knowledge points of the JVM, so that it can be better applied to th ...

Posted on Tue, 23 Jun 2020 04:31:08 -0400 by Jewbilee

Understanding of volatile and code demonstration

    Volatile is a lightweight synchronization mechanism provided by java virtual machine. It has three major features: ensuring visibility, not atomicity, and prohibiting instruction rearrangement. Before you want to understand volatile, you must first understand the running principle of J ...

Posted on Sun, 21 Jun 2020 06:17:13 -0400 by nealios