Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9628

high memory consumption on 64-bit JVMs when managing swing-components


    • Last commented by a User:



      i have been using spring for managing a swing-based client-application recently for the first time, and noticed some strange behaviour: On 64-Bit JVMs the application seems to eat up a lot more memory than expected (about 10 times the memory it uses on 32-Bit JVMs).

      My application, which consists out of only 11 swing-components that are wired together with spring easily eats up 400MB memory. Even the most basic application (one JFrame and one JPanel that gets injected into that Frame) use up more than 150MB already. I will attach a simple test-project (just that 2 classes + applicationContext.xml + required libraries), so you can see for yourself.

      In a memory dump you can see that a lot of java.lang.reflect.Method objects are created, maybe because JFrame (and other Swing Components) inherits like 100 methods or so? See the following answer on stackoverflow: http://stackoverflow.com/a/11620952/1164797 (forget/ignore the question itself though, initially i thought this is related to AnnotationConfigApplicationContext, which i now know is not the case).

      I am not sure, maybe this is just expected because of the number of methods JFrame has? So this might not be a bug at all.. Still, 150MBs for 2 beans seems just unreasonable, doesn't it?




            • Assignee:
              matrium mat rium
              Last updater:
              Chris Beams
            • Votes:
              1 Vote for this issue
              3 Start watching this issue


              • Created:
                Days since last comment:
                5 years, 42 weeks, 2 days ago