jobjectArray RetainedSizeAndHeldObjectsAction::executeOperation()

in src/sizes/retained_size_and_held_objects.cpp [101:118]


jobjectArray RetainedSizeAndHeldObjectsAction::executeOperation(jobject object) {
    std::vector<jobject> objects;
    objects.push_back(object);
    std::vector<jobject> heldObjects;
    jlong retainedSize;
    jlong shallowSize;
    jvmtiError err = estimateObjectSize(object, retainedSize, heldObjects);
    if (!isOk(err)) {
        handleError(jvmti, err, "Could not estimate object size");
    }

    err = jvmti->GetObjectSize(object, &shallowSize);
    if (!isOk(err)) {
        handleError(jvmti, err, "Could not estimate object's shallow size");
    }

    return createResultObject(retainedSize, shallowSize, heldObjects);
}