We are running JBoss 5.1.0.GA which keeps running out of memory in time even with very little load. It's running with Xmx2G and perm gen space of 256m. When I did the memory analysis, I noticed that most of the memory is consumed by a HashMap, which belongs to BaseClassLoader. This HashMap keeps growing until the JVM runs out of heap space. The values in the HashMap are "os.name", "java.specification.vendor" etc. repeated over and over. There are about 8 million of these consuming almost half of 2G allocated to the JVM. I tried searching on Google and found similar problems, but it was either about class blacklist or something unrelated. Does anyone know where these are coming from and why are they not GCed? I am very new to JBoss so I am not sure where to start. I will try to attach some screenshots of the heap analysis.
Most of the memory is consumed by the java.util.Set (domains variable) in BaseClassLoader.