Reputation: 1959
I have a 30MB shared object which is loaded into a java exe via system.load for example:
System.load("mylib.so");
It appears that this loads the complete binary into RAM, causing a 30MB penalty at run time. I am looking for a way to avoid that penalty by means of some paging setting or something similar that prevents the complete shared obj from loading all at once. I need to be more efficient with memory use on an embedded device and this 30MB is the biggest single chunk by far.
Is this possible to improve without actually reducing the size of the shared obj itself (which would be a massive undertaking by the way).
thanks.
Upvotes: 0
Views: 80
Reputation: 23321
This is what System.load is going to do. The same thing happens in a native application, if you link with a so then it will load the whole thing in memory, java can't get around that.
Upvotes: 2