org.jpmml.model.visitors.MemoryMeasurer Maven / Gradle / Ivy
/*
* Copyright (c) 2015 Villu Ruusmann
*/
package org.jpmml.model.visitors;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Set;
import org.dmg.pmml.PMMLObject;
import org.dmg.pmml.VisitorAction;
import org.jpmml.agent.InstrumentationProvider;
import org.jpmml.model.ReflectionUtil;
/**
*
* A Visitor that measures the deep size of a class model object.
*
*
*
* The object size is measured using {@link Instrumentation#getObjectSize(Object)} method.
*
*/
public class MemoryMeasurer extends AbstractVisitor implements Resettable {
private Instrumentation instrumentation = InstrumentationProvider.getInstrumentation();
private long size = 0L;
private Set