8048192: (bf) Out of direct buffer memory message should include the limits

Reviewed-by: alanb, rriggs
This commit is contained in:
Brian Burkhalter 2019-02-22 10:13:34 -08:00
parent b24f8ba2ec
commit 24c70fcf88

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -172,7 +172,10 @@ class Bits { // package-private
} }
// no luck // no luck
throw new OutOfMemoryError("Direct buffer memory"); throw new OutOfMemoryError
("Cannot reserve "
+ size + " bytes of direct buffer memory (allocated: "
+ RESERVED_MEMORY.get() + ", limit: " + MAX_MEMORY +")");
} finally { } finally {
if (interrupted) { if (interrupted) {