Table of Contents

Class JCSharedBufferManager

Namespace
MASES.JCOBridge.C2JBridge
Assembly
C2JBridge.dll

Class managing JCSharedBuffer of JVM

public class JCSharedBufferManager : JVMBridgeBase<JCSharedBufferManager>, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBaseInstance>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition
Inheritance
JCSharedBufferManager
Implements
Inherited Members
Extension Methods

Properties

BridgeClassName

Java class name to be instantiated

public override string BridgeClassName { get; }

Property Value

string

NativeMemoryReserved

Report the native memory reserved using SetNativeMemoryReserved(int)

public static int NativeMemoryReserved { get; }

Property Value

int

NativeMemoryThreshold

Set or get the limit of native memory can be used before trigger the GC for a cleanup

public static int NativeMemoryThreshold { get; set; }

Property Value

int

ReuseByteBuffer

public static bool ReuseByteBuffer { get; set; }

Property Value

bool

Remarks

Set the value to false force a cleanup of the current enqueued buffers

ReuseQueueSize

Report the current number of https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html enqueued for reuse

public static int ReuseQueueSize { get; }

Property Value

int

ReuseQueueThreshold

Set or get the limit of https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html can be enqueued before their discard

public static int ReuseQueueThreshold { get; set; }

Property Value

int

Methods

Create(int)

Creates a new JCOBridgeDirectBuffer<T> instance of byte with a capacity defined from capacity

public static JCOBridgeDirectBuffer<byte> Create(int capacity)

Parameters

capacity int

The capacity of memory to be associated to the returned JCOBridgeDirectBuffer<T> instance of byte

Returns

JCOBridgeDirectBuffer<byte>

The JCOBridgeDirectBuffer<T> instance associated to the built new https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html

Create<T>(T[])

Creates a new JCOBridgeDirectBuffer<T> instance from values in values

public static JCOBridgeDirectBuffer<T> Create<T>(T[] values) where T : unmanaged

Parameters

values T[]

An array of T

Returns

JCOBridgeDirectBuffer<T>

The JCOBridgeDirectBuffer<T> instance associated to the built new https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html

Type Parameters

T

The Type to be used: it can be any byte, short, int, long, float, double

SetNativeMemoryReserved(int)

Sets the reserved native memory can be used from native allocator

public static void SetNativeMemoryReserved(int value)

Parameters

value int

The value of native memory expressed in byte

Remarks

This method can be called only once during startup, further invocation raise an exception since no changes can be done after first memory usage