hbwf / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

MyBatis-spring with high cpu usage in redhat 64 #415

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
1. mybatis-spring1.0.2 with mybatis3.0.6(also with spring3.0.6)
2. jdk1.5.0_22(64 jdk)
3. redhat linux 64

Please describe the problem.  Unit tests are best!
1. I noticed strange phenomenon that once I made the scanner configuration to 
load the mapper files, I found there was no problem in windows by comparison 
with the unbearable speed of loading from spring which means that the whole  
initialization was not complete

2. I use top command(shift + m) to observe the cpu usage for pid, I found that
the service for bootstrap for mappers occupy most of the cpu from arrange 110% 
to 130%.

3. the more surprise that less mapper files could not make the problem and with 
more mapper files added it will produce such problem in redhat linux 64

4. by the way, the mapper interfaces and mapper files all under in some package
and my shell script like this
java -server -Xms1024m -Xmx1024m -Xmn256m -XX:MaxPermSize=256m -Xss128k xxxx &

What is the expected output? What do you see instead?
1. fast load the mapper files and all autowired quickly in spring
2. the initialization completed as usual

Please provide any additional information below.
1. It's hard to reproduce the same case, for you have to make more mappers 
files loaded in the same enviroment.

2. Does someone test the same case like those listed above with more mappers 
file loaded from classpath and with some strict performance test to monitor the 
memory or cpu usage?

Original issue reported on code.google.com by jerrysco...@gmail.com on 16 Oct 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Could you check it with mybatis-spring 1.0.1 (and mybatis 3.0.5) to see if it 
behaves the same?

Original comment by eduardo.macarron on 17 Oct 2011 at 7:40

GoogleCodeExporter commented 9 years ago
mybatis-spring 1.0.1 behaved the same result and I didn't test with mybatis3.0.5

by the way, the mapper files all generated from mybatis generator 1.3.1.

I found another problem  with mybatis-spring in the latest jdk(jdk1.6.0_27 
linux 64)
(it print the stack over flow error due to the operation of 
Configuration.addMapper)

Original comment by jerrysco...@gmail.com on 18 Oct 2011 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago
I think mybatis-spring team should pay more attention to those shown above for 
such case did appear in red hat 64(jdk 64) leaving high CPU usage to impact the 
running.

Original comment by jerrysco...@gmail.com on 20 Oct 2011 at 9:18

GoogleCodeExporter commented 9 years ago
I will close this issue because I cannot reproduce it. Anyway, thanks for the 
report. If it persist we will open it again.

Original comment by eduardo.macarron on 21 Oct 2011 at 7:19