dragon-zhang commented on code in PR #3335:
URL: https://github.com/apache/incubator-shenyu/pull/3335#discussion_r858419842
##########
shenyu-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimiter.java:
##########
@@ -214,13 +214,12 @@ public void acquireInterruptibly(final Object o) throws
InterruptedException {
}
acquireLock.lockInterruptibly();
try {
- final long sum = memory.sum();
final long objectSize = inst.getObjectSize(o);
- while (sum + objectSize >= memoryLimit) {
+ while (memory.sum() + objectSize >= memoryLimit) {
Review Comment:
In the while loop, `memory.sum()` gets the latest value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]