Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loading same dll more than once in a Java JVM

Arun SanbhatAug 23 2018 — edited Aug 24 2018

Hi,

We are currently using Java JRE 1.8 u 131 on WINDOWS. We have a java standalone desktop application that loads a C dll for processing of data.This it does by loading the dll using System.LoadLibrary("Name of the dll") function call.

Currently the Java application is single threaded and is processing the data using JNI functions written in C classes inside the dll.

Due to increase in the data by many folds, we would want to make the java application multi-threaded. The C side code does not support multi-threading and cannot be changed due to legacy issues. So we plan to use Java multithreading feature and load the same dll in each thread.

Each thread should process the data separately. However I am not sure if this will work. Can someone please inform me if a dll when loaded by any one of the Java threads, can other thread also be able to load it again? Will the dll would be loaded in a single memory space in the JVM or can each dll will be allocated a separate memory that can be only be accessed by the thread that has loaded it?

Comments

Hi Ray,
Sorry that the explain plan looks so bad in the output.
When the select output doesn't look good with our extension, the workaround I have been using is the SPOOL command. I find that the file output tends to be easier to read in some cases.
Can you please try adding:
spool c:\myfolder\myspoolfile.txt

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 21 2018
Added on Aug 23 2018
3 comments
3,728 views