Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4158880

JDK in-memory representation of classes hugely inefficient

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1.4, 1.1.6, 1.2.0
    • hotspot
    • generic, x86
    • generic, windows_95, windows_nt



      Name: bk70084 Date: 07/20/98


      This is a request to invest in an effort to reduce the memory
      footprint for classes at runtime, and please not restrict this
      effort to PJava or JavaOS.

      I recently put some printfs into the VM and discovered that the
      memory size of classes is approximately 2 times that of the size
      of the class file. That seems overly expensive, and the result
      is that it's impossible to write full-fledge Java applications
      which aren't HUGE (e.g., 10M) in size.

      One possible area of optimization is with method signatures, where
      you are penalized for having long class names. Imagine a method
      which takes three class arguments, and those classes are defined
      in the "com.marimba.apps.transmitter.workspace" package. The method
      signature in that situation could contain:

          Lcom.marimba.apps.transmitter.workspace.Channel;Lcom.marimba.apps.transmitter.workspace.Workspace;Lcom.marimba.apps.transmitter.ServerContext;

      whereas it's theoretically possible to represent that method signature
      as an array of references into the constant pool or something of that
      nature.

      NOTE: I don't actually know what I am talking about here, but I do
      believe that method signatures are stored in memory and it is true that
      they can be quite large for innocuous looking methods.
      (Review ID: 34227)
      ======================================================================

            sliangsunw Sheng Liang (Inactive)
            bklocksunw Brian Klock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: