Class MoMLParserLeak


  • public class MoMLParserLeak
    extends java.lang.Object
    Leak memory in MoMLParser by throwing an Exception.

    Under Java 1.4, run this with:

     java -Xrunhprof:depth=15 -classpath "$PTII;." ptolemy.moml.test.MoMLParserLeak
     
    and then look in java.hprof.txt.
    Since:
    Ptolemy II 5.2
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static MoMLParser parser
      Note that the parser is what actually leaks here.
    • Constructor Summary

      Constructors 
      Constructor Description
      MoMLParserLeak()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CompositeEntity leak()
      Attempt to leak code by parsing MoML that looks for a class that does not exist.
      static void main​(java.lang.String[] args)
      Attempt to leak code by parsing MoML that looks for a class that does not exist.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • parser

        public static MoMLParser parser
        Note that the parser is what actually leaks here.
    • Constructor Detail

      • MoMLParserLeak

        public MoMLParserLeak()
    • Method Detail

      • leak

        public static CompositeEntity leak()
                                    throws java.lang.Exception
        Attempt to leak code by parsing MoML that looks for a class that does not exist.
        Returns:
        the top level that would be found if the class that does not exist was present
        Throws:
        java.lang.Exception - If the class does not exist.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Attempt to leak code by parsing MoML that looks for a class that does not exist.
        Parameters:
        args - Ignored.
        Throws:
        java.lang.Exception - if there is a problem parsing