equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, 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. |
330 status = CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(value, SoftRefLRUPolicyMSPerMB, verbose); |
330 status = CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(value, SoftRefLRUPolicyMSPerMB, verbose); |
331 } |
331 } |
332 return status; |
332 return status; |
333 } |
333 } |
334 |
334 |
|
335 JVMFlag::Error SoftMaxHeapSizeConstraintFunc(size_t value, bool verbose) { |
|
336 if (value > MaxHeapSize) { |
|
337 JVMFlag::printError(verbose, "SoftMaxHeapSize must be less than or equal to the maximum heap size\n"); |
|
338 return JVMFlag::VIOLATES_CONSTRAINT; |
|
339 } |
|
340 |
|
341 return JVMFlag::SUCCESS; |
|
342 } |
|
343 |
335 JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) { |
344 JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) { |
336 // If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value. |
345 // If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value. |
337 // Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx. |
346 // Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx. |
338 if (UseCompressedOops && FLAG_IS_ERGO(MaxHeapSize) && (value > (max_uintx - MaxHeapSize))) { |
347 if (UseCompressedOops && FLAG_IS_ERGO(MaxHeapSize) && (value > (max_uintx - MaxHeapSize))) { |
339 JVMFlag::printError(verbose, |
348 JVMFlag::printError(verbose, |