Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Performance issues with ArrayList on RCP client using WebSphere(ArrayList, WebSphere Application Server, Table)
Performance issues with ArrayList on RCP client using WebSphere [message #1699657] Thu, 25 June 2015 15:16 Go to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Hi,

I have some Java experience, but I'm new to RCP and I need some help for a performance issue I am faced with right now.
A WebSphere Application Server gets some data from a DB and creates an object (class Part containing fields like serialNr, name and timestamp) for each data set, which is then put into an ArrayList and finally returned to the RCP client application in JSON format.
The client uses JACKSON for deserialization and also creates an ArrayList of Part objects:

ObjectMapper objectMapper = new ObjectMapper();

try {
	partsList = objectMapper
		.readValue(client
		.target("http://xyz.de:9080/test/test/part/find?partnr=J*")
		.request(MediaType.APPLICATION_JSON)
		.get(String.class),
		new TypeReference<List<Part2>>() {});
	System.out.println(partsList.size());
} catch (JsonParseException e1) {
	// TODO Auto-generated catch block
	e1.printStackTrace();
} catch (JsonMappingException e1) {
	// TODO Auto-generated catch block
	e1.printStackTrace();
} catch (IOException e1) {
	// TODO Auto-generated catch block
	e1.printStackTrace();
}


Issues:
At the beginning I used the SWT table widget and for lots of data sets there were serious performance issues, i.e. high memory consumption and long time until the content of the table appeared.
Then I found the virtual table thing on the vogella website (sorry, I have less than 5 posts, so I can't post any links), but there was no improvement. Obviously, the updateElement() method is never called and I don't know why.
Furthermore, I've set a breakpoint and saw that the ArrayList creation takes most of time and resources, i.e. the table is not the culprit.

Questions:
-Is there a better way than creating an ArrayList of objects?
-Concerning the example from the vogella website: Does this work for ArrayLists?
-Any other ideas?

Thank you very much!

Regards,
Mick
Re: Performance issues with ArrayList on RCP client using WebSphere [message #1699817 is a reply to message #1699657] Fri, 26 June 2015 20:12 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Hi,
I've managed to improve the application. Instead of .get(String.class) I am now using .get(InputStream.class) which saves ~1/3 RAM.
I'll have a further look into the updateElement() thing on Monday and hope to find out why it is not getting called (i.e. why println() isn't called/doesn't produce anything) when scrolling the table.

Nevertheless any comments are still appreciated.

Regards,
Mick
Re: Performance issues with ArrayList on RCP client using WebSphere [message #1700863 is a reply to message #1699817] Tue, 07 July 2015 17:44 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Hi,
I have another issue: The service on the application server is always called after clicking on a button and the table is filled. After clicking several times on the button/calling the service, more and more RAM is used. This will be very problematic, if a user of a Java RCP solution behaves exactly in that way.
Shouldn't the Java Runtime Environment free the memory or is there a special trick?

Thanks!

Regards,
Mick
Re: Performance issues with ArrayList on RCP client using WebSphere [message #1700952 is a reply to message #1700863] Wed, 08 July 2015 11:48 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Really nobody has an answer...?
Re: Performance issues with ArrayList on RCP client using WebSphere [message #1700957 is a reply to message #1700952] Wed, 08 July 2015 12:14 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2515
Registered: July 2012
Senior Member
I really don't understand what your issue is and if it is related to Eclipse.

It sounds like you are having trouble with the SWT table widget. I guess they have their own forum. The next thing is that you are saying that you are loading all the data from the server into the client. So of course memory is used, whereelse should the objects that are created stored otherwise?

Regarding freeing of memory, well as long as there is a pointer to your data, the GC can't free the memory. So I assume somewhere you still hold the reference.

If a user clicks several times on a button and this is problematic because your service is called often which leads to memory issues, you should implement your button in a way that it is disabled on the beginning and enabled again after the call is done. This is best practice UX.

Sorry, but your question is too general and I'm not sure if it is in any way related to Eclipse 4 RCP. It sounds more like a general issue regarding Java, references and memory consumption.
Re: Performance issues with ArrayList on RCP client using WebSphere [message #1701419 is a reply to message #1700957] Mon, 13 July 2015 11:11 Go to previous message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
The issues from my first post have been resolved.
With clicking several times on the button I meant the steps button click -> table shows data -> button click -> table shows data -> ... , i.e. no abusive use of the button.
Setting the ArrayList to null right after clicking on the button and before getting the data from the service, shows some improvement. Apart from this maybe https://www.eclipse.org/articles/swt-design-2/swt-design-2.html will do the trick.

I'll keep you informed!
Previous Topic:Eclipse 4 Open Application.e4xmi file Error
Next Topic:Multi-Lined TrimBar
Goto Forum:
  


Current Time: Tue Oct 24 02:29:48 GMT 2017

Powered by FUDForum. Page generated in 0.01710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software