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

DCmd framework unnecessarily creates a DCmd instance on registration

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b15

      The DCmd factory instances are created and registered at VM startup via management_init(). Creation does:

      template <class DCmdClass> class DCmdFactoryImpl : public DCmdFactory {
      public:
        DCmdFactoryImpl(uint32_t flags, bool enabled, bool hidden) :
          DCmdFactory(get_num_arguments<DCmdClass>(), flags, enabled, hidden) { }

      where get_num_arguments() instantiates the given DCmd to dynamically determine the number of arguments (args and options) that it takes. This should be determined statically as the value is statically known.

      Dropping all the unnecessary DCmd creation and cleanup should improve startup.

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: