You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "carryxyh (GitHub)" <gi...@apache.org> on 2018/11/29 02:12:20 UTC
[GitHub] [incubator-dubbo] carryxyh opened issue #2845: OOM in UT
testSelectByWeight
- [x] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
### Environment
* Dubbo version: master branch
* Operating System version: macos
* Java version: 1.8
### Steps to reproduce this issue
1. `./mvnw test -pl dubbo-cluster -Dtest=org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalanceTest`
### Expected Result
What do you expected from the above steps?
UT passed
### Actual Result
What actually happens?
OOME thrown
If there is an exception, please attach the exception trace:
```
Running org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalanceTest
[29/11/18 12:24:27:027 CST] main INFO logger.LoggerFactory: using logger: org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-6"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "surefire-forkedjvm-command-thread"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "last-ditch-daemon-shutdown-thread-30sec"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-5"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-1"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-10"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-7"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-9"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-2"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-3"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-8"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-4"
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 158.071 sec <<< FAILURE! - in org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalanceTest
org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalanceTest Time elapsed: 145.903 sec <<< ERROR!
java.lang.OutOfMemoryError: Java heap space
Results :
Tests in error:
RoundRobinLoadBalanceTest.org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalanceTest » OutOfMemory
```
### Root cause analysis
Our mocked weightInvoker is recoding details of every single invocation which will consuming a lot of memory. please ref [Mockito throws an OutOfMemoryError on a simple test](https://stackoverflow.com/questions/17437660/mockito-throws-an-outofmemoryerror-on-a-simple-test/28833727#28833727)
The maximum heap size of our test process specified in pom.xml is **512MB** which is not enough for this test case (**RoundRobinLoadBalanceTest#testSelectByWeight**)
### Solutions
- Option A, simply increase `-Xmx` in `argline`
- Option B, mock weightInvoker$ with MockSettings `stubOnly `
In my view, if the invoking details is not that necessary we can choose Option B.
And I will send a PR later.
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2845 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh closed issue #2845: OOM in UT
testSelectByWeight
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
[ issue closed by carryxyh ]
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2845 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh closed issue #2845: OOM in UT
testSelectByWeight
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
[ issue closed by carryxyh ]
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2845 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org