nickylin / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Replace classpool to free up memory after each test case? #192

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
PowerMock may consume a lot of memory due to the Javassist classpool. We do
detach on the CtClass after it's use but perhaps we need to re-instantiate
the ClassPool after each test case to free up memory.

Original issue reported on code.google.com by johan.ha...@gmail.com on 3 Nov 2009 at 8:19

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 16 Nov 2009 at 7:17

GoogleCodeExporter commented 9 years ago
This doesn't seem to work. We must investigate the memory consumption. Probably 
the
MCL cannot be GC'ed for some reason.

Original comment by johan.ha...@gmail.com on 18 Nov 2009 at 8:21

GoogleCodeExporter commented 9 years ago
Our project gets over 1.5 gig of memory usage with PowerMock. Something has to 
be done 
before our number of tests causes PowerMock to use more memory than our cruise 
control 
server has available :)

Original comment by bwa...@gmail.com on 5 Jun 2010 at 3:04

GoogleCodeExporter commented 9 years ago
Hehe that sounds awful. I've tried to look into it a while ago but I couldn't 
locate
the cause. I'm currently bicycling across Sweden so I don't have much time to 
look
into it right now. Feel free to help us out in anyway if you like.

Original comment by johan.ha...@gmail.com on 5 Jun 2010 at 4:25

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 22 Jul 2010 at 9:20

GoogleCodeExporter commented 9 years ago
We at Atlassian ran into this problem when using PowerMock.  We have 12,0000 
tests derived from a base class that ran with the PowerMock runner and hence 
the memory usage went though the rood even before the test where run.

We had to remove the dependency on PowerMock and use it on an as needed basis. 
(static class mocking versus general unit tests)

Original comment by bbaker...@gmail.com on 1 Dec 2010 at 1:50

GoogleCodeExporter commented 9 years ago
We've instigated this a bit further and we think that the problem lies not in 
PowerMock but in EasyMock (and possibly Mockito but we haven't looked at 
Mockito yet).

I've created a patch for EasyMock to solve one of the two problems that we've 
found. The issue is here:
https://sourceforge.net/tracker/?func=detail&aid=3145906&group_id=82958&atid=567
837

Original comment by johan.ha...@gmail.com on 27 Dec 2010 at 9:24