First: Mockito uses CGLIB to create mocks, and PowerMock uses Javassist for some other things, such as removing final tokens, Powermock also loads classes into the new ClassLoader. CGLIB is known for eating the Permanent Generation (just google CGLIB PermGen to find relevant results on this).
This is not a direct answer, as it depends on the details of your project:
As you pointed out, there is a static helper class, I donโt know if it stores static variables with mocks, I donโt know the details of your code, so this is pure conjecture and other readers who actually know better can fix me.
Maybe the ClassLoader (and at least some of his children) that loaded this static class can be saved in tests - maybe because of the statics (which lives in the class area) or because of some link somewhere- then this means that if the ClassLoader is still alive (i.e. does not collect garbage), its loaded classes are not discarded, i.e. classes, including those generated, are still in PermGen .
These classes can also be huge in size, if you have many of these classes to load, this may be related to higher PermGen values, especially since Powermock needs to reload the classes in the new Classloader for each test.
Again, I donโt know the details of your project, so Iโm just guessing, but your problem with the constant generation can be caused either by point 1 or point 2, or even both.
In any case, I would say yes: a static class that could return a static mocked object looks like bad practice here, as is usually done in production code. If it is poorly crafted, it can lead to a ClassLoader leak (this is nasty!).
In practice, I have seen hundreds of tests (only with Mockito), without changing the memory settings, and without observing that CGLIB proxies are unloaded, and I do not use static things, and not the ones used in the Mockito API.
If you are using the Sun / Oracle JVM, you can try these options to keep track of what is happening:
-XX:+TraceClassLoading and -XX:+TraceClassUnloading or -verbose:class
Hope this helps.
Out of scope of this question:
Personnaly I still don't like to use Powermock, I only use it in corner cases, for example. for testing immutable legacy code. Powermock is too intrusive imho, it must generate a new classloader for each test to perform its actions (modification of bytecode), you should annotate the test classes to a great extent, so that they can be mocked ... In my opinion, for normal development all these minor inconveniences go off balance in favor of cunning to make fun of the finals. Even Johan, author of Powermock, once told me that he recommended Mockito instead and kept Powermock for some specific purpose.
Don't get me wrong: Powermock is a fantastic technology that really helps when you have to deal with (poorly) developed legacy code that you cannot change. But not for everyday development, especially if it is important for TDD.