|
1 | 1 | /* |
2 | | - * Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | | - * Copyright (c) 2023, 2023, Red Hat Inc. All rights reserved. |
| 2 | + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. |
| 3 | + * Copyright (c) 2023, 2024, Red Hat Inc. All rights reserved. |
4 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 | 5 | * |
6 | 6 | * This code is free software; you can redistribute it and/or modify it |
@@ -89,7 +89,7 @@ boolean sample(Object obj, UnsignedWord allocatedSize, int arrayLength) { |
89 | 89 | } |
90 | 90 | } |
91 | 91 |
|
92 | | - store(obj, allocatedSize, arrayLength); |
| 92 | + store(obj, span, allocatedSize, arrayLength); |
93 | 93 | return true; |
94 | 94 | } |
95 | 95 |
|
@@ -142,17 +142,17 @@ private void release(JfrOldObject sample) { |
142 | 142 | } |
143 | 143 |
|
144 | 144 | @Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true) |
145 | | - private void store(Object obj, UnsignedWord allocatedSize, int arrayLength) { |
| 145 | + private void store(Object obj, UnsignedWord span, UnsignedWord allocatedSize, int arrayLength) { |
146 | 146 | Thread thread = JavaThreads.getCurrentThreadOrNull(); |
147 | 147 | long threadId = thread == null ? 0L : JavaThreads.getThreadId(thread); |
148 | 148 | long stackTraceId = thread == null ? 0L : SubstrateJVM.get().getStackTraceId(JfrEvent.OldObjectSample, 0); |
149 | 149 | UnsignedWord heapUsedAfterLastGC = Heap.getHeap().getUsedMemoryAfterLastGC(); |
150 | 150 |
|
151 | 151 | JfrOldObject sample = (JfrOldObject) freeList.pop(); |
152 | | - sample.initialize(obj, allocatedSize, threadId, stackTraceId, heapUsedAfterLastGC, arrayLength); |
| 152 | + sample.initialize(obj, span, allocatedSize, threadId, stackTraceId, heapUsedAfterLastGC, arrayLength); |
153 | 153 | queue.add(sample); |
154 | 154 | usedList.append(sample); |
155 | | - totalInQueue.add(allocatedSize); |
| 155 | + totalInQueue = totalInQueue.add(span); |
156 | 156 | } |
157 | 157 |
|
158 | 158 | @Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true) |
|
0 commit comments