Old GC problems caused by Groovy scripts
Recently, a system was launched, and Groovy script was used for authentication. The example code is as follows
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("groovy");
String function = String.format("def getTargetParamValue(%s) {return \"%s\"}", "o", "$o");
engine.eval(function);
Invoc ...
Posted by joe2 on Mon, 25 Nov 2019 12:20:48 -0800
Java Serial 53-Single Case Model Preliminary, final Keyword Supplement, Review Points of Knowledge
1. Review
1. Differences between Classes and Objects
2.UML(uniform makeup language)
3. Method areas store static variables, constants (static final modifications)
4. Stored objects in heap memory
5. Stack Storage Variables
6.this() can be used to construct the first line of the method
7.static static statement blocks (static statement blocks ar ...
Posted by mortona on Mon, 25 Nov 2019 11:53:58 -0800
logback log file location dynamic specification
Reference resources: https://stackoverflow.com/questions/19518843/logback-configuration-via-jvm-argument
logback related configuration, where ${log ﹣ home} is the environment variable. When java starts the application, it can set its address dynamically by specifying java - dlog ﹣ home = "path".
<?xml version="1.0" encoding="UT ...
Posted by fizzwizz on Tue, 19 Nov 2019 13:27:35 -0800
Reentrantlock details
Reprint link: https://www.cnblogs.com/takumicx/p/9338983.html
About ReentrantLock
The implementation of exclusive lock in jdk can use ReentrantLock in addition to the keyword synchronized. Although there is no difference between ReentrantLock and synchronized in performance, ReentrantLock has more functions, is more flexible in use, and is more ...
Posted by haku87 on Tue, 19 Nov 2019 08:36:01 -0800
[learn data structure from today 02] stack and queue
Catalog
1. Understand stack and queue
2. Talk about stack with code
3. Talk about queues with code
Let's talk about stack and queue today.
Review the previous chapter [data structure 01] array As long as the subscript of the data is known in the array, the data can be queried quickly through sequent ...
Posted by jimmyhumbled on Mon, 18 Nov 2019 04:01:51 -0800
Try to learn many times, and finally understand NIO!
NIO—NonBlocking IO(new IO)
io flow oriented programming can only be used as one of the input or output flows. It is synchronous blocking. Every connection needs to create a thread to handle. The thread context switching overhead is very large, which creates a big bottleneck
So the pseudo blocking IO implemented by thread pool solves the proble ...
Posted by phast1 on Thu, 14 Nov 2019 22:25:57 -0800
Thread processing two or three things
[mandatory] thread pools are not allowed to be created by Executors, but by ThreadPoolExecutor. Such a processing method enables the students who write to be more clear about the running rules of thread pools and avoid the risk of resource exhaustion. The above is the mandatory provision on concurrency in the java Development Manual of Alibaba. ...
Posted by noobcody on Wed, 13 Nov 2019 00:12:45 -0800
[Java Core Technology Volume] Deep understanding of Java's internal classes
The analysis is illustrated:This diagram shows the process of compiling and interpreting Java internal classes. You will see that the process is cumbersome.
For historical reasons, Java language specifications and byte code language specifications do not overlap, initially they overlap. But with the development of Java, something new needs to b ...
Posted by renegade44 on Tue, 12 Nov 2019 18:55:27 -0800
Implementation of the java-RGB color palette (anonymous internal class of event listeners)
Title requirements:
**Require a case where three JSliders are used to select values of R, G, B primary colors. Users can dynamically synthesize a color using the active JSlider slider. The synthesized color is displayed on the interface.**
Code Ideas Analysis:1. Required Components
(1)JFrame window
(2) RGB tag text component of JLabel
(3) Nu ...
Posted by mcatalf0221 on Mon, 11 Nov 2019 19:32:01 -0800
[concurrent programming] ThreadLocal is very simple
What is ThreadLocal
ThreadLocal is a bit like a Map type data variable. Each thread of a ThreadLocal type variable has its own copy, and the modification of this variable by one thread will not affect the values of other thread copies. Note that a ThreadLocal variable can only set one value.
ThreadLocal<String> localName = new ThreadLocal ...
Posted by prasadharischandra on Mon, 11 Nov 2019 04:56:55 -0800