cancel
Showing results for 
Search instead for 
Did you mean: 

Slowness with setTableLocation when using Java 8 (1.8)

0 Kudos

I have a NetBeans 8.0.1 platform application, and I've run into some problems with Crystal Reports running very slowly with Java 8, where everything seems to be fine in Java 7.

I narrowed the problem code fragment to the CR setTableLocation() method:


ITable tb1 = rcdProposal.getDatabaseController().getDatabase().getTables().findTableByAlias("CdProposal");
int i1 = rcdProposal.getDatabaseController().getDatabase().getTables().findByAlias("CdProposal");
ru1.setTableLocation(tb1, fileXML);
DatabaseController dbc1 = rcdProposal.getDatabaseController();
ITable tb2 = dbc1.getDatabase().getTables().getTable(i1);
Long l1 = System.currentTimeMillis();
dbc1.setTableLocation(tb2, tb1); //<-- problem statement
l1 = System.currentTimeMillis() - l1;
String str1 = System.getProperty("java.version") + " dbc1.setTableLocation Time elpased (ms): "

    + Long.toString(l1);
System.out.println(str1);

The issue seems to be that the first time that the setTableLocation() method is executed, it takes a very long time in Java 8, although subsequent calls are much faster. Here is the output for five report views for the Netbeans 8.0.2 app running on both Java 1.8 and Java 1.7

1.8.0_25 dbc1.setTableLocation Time elpased (ms): 38705
1.8.0_25 dbc1.setTableLocation Time elpased (ms): 1717
1.8.0_25 dbc1.setTableLocation Time elpased (ms): 1672
1.8.0_25 dbc1.setTableLocation Time elpased (ms): 1712
1.8.0_25 dbc1.setTableLocation Time elpased (ms): 1668

1.7.0_45 dbc1.setTableLocation Time elpased (ms): 2292
1.7.0_45 dbc1.setTableLocation Time elpased (ms): 334
1.7.0_45 dbc1.setTableLocation Time elpased (ms): 287
1.7.0_45 dbc1.setTableLocation Time elpased (ms): 191
1.7.0_45 dbc1.setTableLocation Time elpased (ms): 150

Any ideas? Apparently class loading has somehow changed in Java 8.  I've googled around, but really can't find anything that addresses this issue.  I've tried increasing various memory allocations, tried server mode for the JVM, but nothing seems to work.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

For anyone interested, I have finally found a solution to this nagging problem!

In other forums, recently there have been reports of poor performance with Java 8 when it is necessary to access JAR files that are contained in a master JAR file.  In taking a look at the CR jar files, I found one such JAR file: XMLConnector.jar, which is a collection of JAR and MAR files for CR classes and various third party stuff.

After unzipping XLConnector.jar into a folder, and adding that folder to the classpath, the slowness is gone, and performance is on par with Java 7, and everything else seems to be working fine with Java 8.  So, the key seems to be to not use JAR files that are a collection of other JAR files when using Java 8.

If you happen to be using CR in a NetBeans 8.x platform application with Java 8, I have made a post in the NetBeans forums explaining how to implement the above solution.

NetBeans Forums - How to track down missing resources with NetBeans debugger / profiler

Answers (3)

Answers (3)

Former Member
0 Kudos

Refer to the product availability matrix to know supported platforms here

http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/20c69834-cfc4-2b10-da81-960222254...

Thanks,

Prithvi

junwu
Active Contributor
0 Kudos

does sap support java 8?

former_member193379
Active Contributor
0 Kudos

Hi Joseph,

I don't have any idea about Crystal Reports but from java side there are some performance concerned raised by Developers like compilation is slow but some of Developers experienced better performance in Collection Package.

Please have a look of the below link if it helps

http://java-performance.com/

Thanks,

Hamendra