felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: JarX use in Felix 2.0.5
Date Tue, 16 Nov 2010 12:35:37 GMT
On 11/16/10 7:19, Jackson, Bruce wrote:
> Well, as you suspected, the heap is being eaten up by the Manifest object
> in JarFileX (see attached) which in turn is because of the HashMap in the
> Manifest class. In terms of going about fixing this, there appears to be
> only one place where the Manifest is actually fetched:
> JarRevision: line 102
> ...and this seems to only be called from BundleImpl.createModule(). If so,
> once a bundle has been created, can we just dump the Manifest for the
> JarFileX, or is it used elsewhere?

We don't keep the Manifest object at all, we just keep the main
attributes from it, so I'm not sure what more we can do here.

The way I solved this previously in my prototyping was to create my own
manifest parser and parse the manifest file using an input stream.
Therefore Manifest was never created in the first place.

-> richard

> On 11/11/2010 16:48, "Richard S. Hall" <heavy@ungoverned.org> wrote:
>> On 11/11/10 11:15, Jackson, Bruce wrote:
>>> Good plan. I'll take a look at the heap analysis and see where its all
>>> being eaten up and report back.
>> I might be able to hack up a quick snapshot with my own manifest parsing
>> code, since I already have some of that work done. Let me know.
>> -> richard
>>> Thanks
>>> Bruce
>>> On 10/11/2010 22:26, "Richard S. Hall" <heavy@ungoverned.org> wrote:
>>>> On 11/10/10 16:07, Jackson, Bruce wrote:
>>>>> Yes, the issue I have is that the cached jarfile manifests are taking
>>>>> around 30% of the total heap used by our application, and since we're
>>>>> running embedded into an Android app and therefore have a maximum heap
>>>>> size of only 16Mb, its something that¹s grabbing my attention.
>>>>> Do you know: is there a great deal of difference in runtime heap usage
>>>>> between 2.0.5 and 3.x?
>>>> I have no idea, but the JAR manifest usage should be the same, since it
>>>> still works the same way. I wouldn't expect a great deal of difference.
>>>> Again, I'm willing to work on some ideas for improving memory
>>>> consumption if you are willing to do the analysis...
>>>> -> richard
>>>>> On 10/11/2010 14:56, "Richard S. Hall"<heavy@ungoverned.org>  wrote:
>>>>>> On 11/10/10 6:58, Jackson, Bruce wrote:
>>>>>>> Hi
>>>>>>> Does anyone know: is there a way of controlling or reducing the
>>>>>>> usage of the class org.apache.felix.framework.util.JarFileX in
>>>>>>> 2.0.5?
>>>>>>> Alternatively: does anyone know if this has been made more efficient
>>>>>>> in
>>>>>>> 3?
>>>>>> That class is a simple extension to JarFile to work around a bug
>>>>>> improper handling of directory entries. I find it hard to believe
>>>>>> that
>>>>>> it could be causing any significant heap usage since it maintains
>>>>>> state. I think you are just seeing the heap being used by JarFile
>>>>>> itself.
>>>>>> If I recall, I think the memory issues stem from JarFile's manifest
>>>>>> parsing. I actually wrote some code to do the parsing myself and
>>>>>> did
>>>>>> appear to help memory usage, but not performance. Since I was looking
>>>>>> for performance improvement, I didn't continue with it.
>>>>>> If you wanted to test the impact to see if it is worthwhile, I could
>>>>>> look into it again. If so, open a JIRA issue and we can try to work
>>>>>> together on it.
>>>>>> ->  richard
>>>>>>> Thanks
>>>>>>> Bruce

View raw message