I have a VBA script running in Excel 2010 which invokes a java swing app using the ActiveX bridge.
Below is a short snippet of what happens
Set Requester = CreateObject("ERequester.Bean.1")
Set RequestResult = Requester.executeRequest(some parameters.....)
dArray = RequestResult.getResultStringArray()
At the Java side (using jdk1.6.0_26) the getResultStringArray() function is as given below
public String getResultStringArray()
String ticValues= new String;
Some code which creates local string objects and sets it to each position in the array
After calling RequestResult.getResultStringArray() and releasing the array at VBA side the stings are still present in jvm memory and are not garbage collected
As the function gets called multiple times, JVM continuously keeps increasing its memory footprint until it reaches the max limit and causes OutOfMemoryError.