File tree Expand file tree Collapse file tree
tool-java-hotcode/src/main/java/com/wdbyte/hotcode Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .wdbyte .hotcode ;
22
3+ import java .math .BigDecimal ;
34import java .util .ArrayList ;
45import java .util .HashSet ;
56import java .util .List ;
@@ -58,15 +59,13 @@ private static void allocate() {
5859 Thread .currentThread ().setName ("memory_allocate_thread_1" );
5960 int index = 1 ;
6061 while (true ) {
61- array = new int [1 * index * 1000 ];
62- array = new Integer [1 * index * 1000 ];
62+ array = new BigDecimal [1 * index * 1000 ];
6363 try {
6464 Thread .sleep (1000 );
6565 } catch (InterruptedException e ) {
6666 throw new RuntimeException (e );
6767 }
6868 index ++;
69-
7069 }
7170 }).start ();
7271
@@ -140,7 +139,7 @@ public static void addHashSetThread() {
140139 while (true ) {
141140 try {
142141 hashSet .add ("count" + count );
143- Thread .sleep (10 );
142+ Thread .sleep (5 );
144143 count ++;
145144 } catch (InterruptedException e ) {
146145 e .printStackTrace ();
You can’t perform that action at this time.
0 commit comments