equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
179 |
179 |
180 @Override |
180 @Override |
181 public void run() { |
181 public void run() { |
182 System.out.println("Start the thread " + threadId); |
182 System.out.println("Start the thread " + threadId); |
183 while (TestStressIHOPMultiThread.this.isRunning()) { |
183 while (TestStressIHOPMultiThread.this.isRunning()) { |
184 allocate(amountOfGarbage); |
184 try { |
|
185 allocate(amountOfGarbage); |
|
186 } catch (OutOfMemoryError e) { |
|
187 free(); |
|
188 System.out.println("OutOfMemoryError occurred in thread " + threadId); |
|
189 break; |
|
190 } |
185 free(); |
191 free(); |
186 } |
192 } |
187 } |
193 } |
188 |
194 |
189 private void silentJoin() { |
195 private void silentJoin() { |