Tensorflow Java 2.10.1 memory leak issue on constant creation
@posuhov,
Could you please provide the error log which you are facing the issue, that helps to analyse the issue in deeper. Thank you! @tilakrayal there is no error log. 8Gb of memory consumed within 8 seconds by the code snippet I've attached to the issue description. Once there is no memory anymore device just stop to functioning. 
I can attach library that I've compiled if it helps.
[libtensorflow-2.10.1.jar.zip](https://github.com/tensorflow/tensorflow/files/13773517/libtensorflow-2.10.1.jar.zip)

Also I attach 2 screenshots where we can see that allocated memory for process on linux is not visible by java. From java's point of view we use only 147Mb, but from OS point of view - 7.2Gb
![1](https://github.com/tensorflow/tensorflow/assets/1525347/a62497ad-2d6b-4286-b8c6-ef110fcc43a2)
![2](https://github.com/tensorflow/tensorflow/assets/1525347/b3d7a57b-2938-4a89-948f-61b5521e3f73)
 @sachinprasadhs an updates on that?  I was able to compile the version 2.15.0 on Ubuntu(20.04) using a command

```
bazel build --config=elinux_aarch64 \
  --copt=-O2 \
  --config=monolithic \
  --define tensorflow_mkldnn_contraction_kernel=0 \
  --verbose_failures \
  --config=nonccl \
  --config=nogcp \
  //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni
```
It didn't start on the Raspberry Pi with Debian and bullseye, but I was able to make it work on Raspberry with Ubuntu. Unfortunately, the memory leak issue is still reproduceable with 2.15.0 
@sachinprasadhs @tilakrayal  can I expect someone to take a look on this issue? Since support here is awful and not able to respond during several months, I will post a solution here, maybe it will be useful for somebody. The problem was that `Ops.create()` creates an internal eager session under the hood and all createdconstants are stored there. To fix it we need to move ops creation inside the loop and create a different session every time for it. like
```
EagerSession eagerSession = EagerSession.create();
Ops ops = Ops.create(eagerSession);
...
eagerSession.close();
```
with this approach memory is stable and not growing Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62686">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62686">No</a>

### Issue type

Support

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

2.10.1

### Custom code

No

### OS platform and distribution

debian aarch64

### Mobile device

Raspberry pi

### Python version

_No response_

### Bazel version

5.1.1

### GCC/compiler version

11.4.0

### CUDA/cuDNN version

no

### GPU model and memory

no

### Current behavior?

I've built tensorflow java for raspberry and aarch64 architecture with following command on Ubuntu 22.04
```
bazel build --config=elinux_aarch64 \
--copt=-std=gnu11 \
--copt=-O2 \
--config=monolithic \
--define tensorflow_mkldnn_contraction_kernel=0 \
--verbose_failures \
//tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni
```
When the constant is created in a code, it seems it doesn't free a memory properly. The memory consumption reaches 8Gb in 8 seconds.
I've identified that the problem is in this invocation which is invoked in Constant class
https://github.com/tensorflow/tensorflow/blob/v2.10.1/tensorflow/java/src/main/java/org/tensorflow/op/core/Constant.java#L642-L647
However I stuck here. Unfortunately, I can't build the most recent tensorflow 2.15.0  because it fails with some strange error.
Could you please help me to identify what I'm doing wrong?

### Standalone code to reproduce the issue

```shell
public static void main(String[] args) {
        Ops ops = Ops.create();
        System.out.println("Ops created");
        int capacity = 480 * 640 * 3;
        ByteBuffer byteBuffer = ByteBuffer.allocateDirect(capacity);
        for (int i = 0; i < capacity; i++) {
            byteBuffer.put((byte) 200);
        }
        byteBuffer.rewind();
        while (!Thread.interrupted()) {
            byteBuffer.rewind();
            long[] imageShape = new long[]{480, 640, 3};
            Constant<UInt8> constant = ops.constant(UInt8.class, imageShape, byteBuffer);
            System.out.println(constant);
        }
    }
```


### Relevant log output

_No response_