Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvMsg.dispose()

Method

## Declaration

    void dispose()

## Purpose

Release native storage associated with the message.

## Remarks

In the native (JNI) preferred implementations, messages occupy storage outside of the Java environment (that is, in the native C environment) and also within the Java environment. When the Java garbage collector recycles the Java message object, this action triggers release of the corresponding native storage as well.

However, the timing of garbage collection is unpredictable, delaying the release of native storage as well. In applications where efficient management of native storage is a critical performance factor, you can use this method to explicitly free the native storage.

Call this `dispose` method at the end of a message callback method to immediately free the native storage associated with the message. The Java message object is independent of the native storage (and independent of this method), and it remains intact until the Java garbage collector recycles it in the usual way.

Attempting to access the message after calling this method results in an exception. (However, TibrvMsg.getSendSubject() and TibrvMsg.setReplySubject() retrieve `null` rather than throwing an exception

## Restrictions

`dispose()` is available only in the JNI preferred implementation. It is not available in the JNI backward compatibility implementation, nor in the pure Java implementation.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.