Page 1 of 1

WURFL Memory footprint

Posted: Wed Jul 09, 2014 8:33 am
by accorhotels
Hello,

I'm using wurfl 1.5.1 Java API and have questions about the memory usage of the WURFL database.

I produced a HeapDump and found with Eclipse MAT that the memory consumption was 20.3MB (see image attached)

Is there a way to reduce the size of the model in memory ?

I'm using Spring for the configuration and limit the capabilities to this set :

Code: Select all

<bean id="detectionEngine" class="net.sourceforge.wurfl.core.GeneralWURFLEngine">
        <property name="cacheProvider" ref="deviceCacheProvider" />
        <constructor-arg index="0" value="classpath:/wurfl.zip" />
        <property name="capabilityFilter">
            <set>
                <value>device_os</value>
                <value>device_os_version</value>
                <value>brand_name</value>
                <value>model_name</value>
                <value>marketing_name</value>
                <value>is_tablet</value>
                <value>is_wireless_device</value>
                <value>resolution_height</value>
                <value>resolution_width</value>
                <value>pointing_method</value>
                <value>mobile_browser_version</value>
                <value>mobile_browser</value>
                <value>ux_full_desktop</value>
                <value>preferred_markup</value>
                <value>xhtml_support_level</value>
            </set>
        </property>
    </bean>
Image

Thanks in advance

Re: WURFL Memory footprint

Posted: Wed Jul 09, 2014 2:00 pm
by Elliotfehr
Hello,

Unfortunately, it is not possible to reduce the memory usage by a significant amount as it is necessary for the wurfl.xml file to be loaded into memory for performance reasons.

Thank you,

Elliot

Re: WURFL Memory footprint

Posted: Wed Jul 09, 2014 3:36 pm
by Elliotfehr
Hello,

I am currently working with my Java team to see if we can reduce the memory usage and will let you know when we have an update.

Thank you,

Elliot

Re: WURFL Memory footprint

Posted: Thu Jul 10, 2014 7:11 am
by accorhotels
Ok, thank you for the quick answer.

Re: WURFL Memory footprint

Posted: Thu Jul 10, 2014 11:44 am
by Elliotfehr
To clarify,

When the Java API starts, it will load the wurfl.xml as well as a few other resources needed by the application into the memory in order maximize performance, which explains the memory consumption that you mentioned. It is possible to reduce this overhead with a capability filter (as you have done) in order to reduce the amount loaded into memory.

We do try to keep this memory consumption as low as it is in order to reduce the overhead to maximize the number of environments that WURFL can operate in.

Thank you,

Elliot