public void ResetHeapData()
        {
            ObjectsList.Clear();
            ObjectTypeCodes.Clear();
            ReferenceCodes.Clear();
            FieldReferenceCodes.Clear();
            RealObjectCount = 1;

            // The 'unknown' object
            ObjectInfo ob = new ObjectInfo();

            ob.Code      = ObjectMapReader.UnknownObjectId;
            ob.Size      = 0;
            ob.RefsIndex = 0;
            ob.RefsCount = 0;
            ObjectTypeCodes.Add(ObjectMapReader.UnknownTypeId);
            ObjectsList.Add(ob);
        }
Example #2
0
        ///<summary>
        ///Called by the agent when it is ready to initialize the SIFProfilerClient instance
        ///of the ADK. This must be done after the agent has learned the Session ID to associate
        ///with all recorded metrics.
        ///</summary>
        public static void StartProfiling(int sessionId, ObjectTypeCodes otcImpl)
        {
            Adk.Log.Debug("SIFProfilerClient instance name: " + fProfName);
            ProfilerUtils.setProfilerSessionId(sessionId);
            ADK.getLog().debug("SIFProfilerClient session ID: " + fSessionId);


            com.OpenADK.sifprofiler.SIFProfilerClient prof =
                com.OpenADK.sifprofiler.SIFProfilerClient.getInstance(fProfName);
            if (prof != null)
            {
                try {
                    prof.setObjectTypeCodesImpl(otcImpl);
                    prof.open(new com.OpenADK.sifprofiler.api.ProfilerSession(ProfilerUtils.getProfilerSessionId()));
                } catch (Exception ex) {
                    Console.WriteLine("Failed to open SIFProfilerClient instance: " + ex);
                    System.exit(-1);
                }
            }
        }
Example #3
0
        ///<summary>
        ///Called by the agent when it is ready to initialize the SIFProfilerClient instance
        ///of the ADK. This must be done after the agent has learned the Session ID to associate
        ///with all recorded metrics.
        ///</summary>
        public static void StartProfiling(int sessionId, ObjectTypeCodes otcImpl)
        {
            Adk.Log.Debug( "SIFProfilerClient instance name: " + fProfName );
            ProfilerUtils.setProfilerSessionId( sessionId );
            ADK.getLog().debug( "SIFProfilerClient session ID: " + fSessionId );

            com.OpenADK.sifprofiler.SIFProfilerClient prof =
            com.OpenADK.sifprofiler.SIFProfilerClient.getInstance( fProfName );
            if( prof != null ) {
            try {
                prof.setObjectTypeCodesImpl( otcImpl );
                prof.open( new com.OpenADK.sifprofiler.api.ProfilerSession( ProfilerUtils.getProfilerSessionId() ) );
            } catch( Exception ex ) {
                Console.WriteLine( "Failed to open SIFProfilerClient instance: " + ex );
                System.exit(-1);
            }
            }
        }