Projects‎ > ‎XForms‎ > ‎

New XForms State Store


This project is completed as of 2011-01-20.


As of 2011-01, the XForms engine uses a combination of memory store and disk-based (via eXist) for storing state. See: .XForms - State Handling.

Profiling has shown issues with the solution as currently implemented:

  • As the disk store grows, performance tends to be reduced. 2011-01-05 upgrade to eXist 1.4 improved this a bit.
  • Memory consumption is high:
    • memory store is typically configured with at least 20 MB of heap.
    • eXist caches typically add tens of MB to that
  • CPU usage is high, up to 25 % of a page load time once the memory store is full.
    • gzip / encryption of state is costly
    • storage into eXist is relatively costly
    • XForms instance serialization (creation of the dynamic state) is costly


Use existing cache e.g. Ehcache [DONE]

See: Ehcache.

Next steps:
  • evaluate Ehcache
  • see if disk store would be appropriate
  • see difficulty of expiring cache entries by session id
  • used Ehcache with disk store
  • don't worry about expiring by session id and use "time to idle" instead
  • configurable via oxf:/config/ehcache.xml

Custom solution [REJECTED]

Idea: write to a plain disk-based database.

Possible disk layout:
  • session-id
    • dynamic-state-uuid
      • initial
      • current
  • static-state-uuid
    • session-id
This layout would allow relatively easily garbage collecting data as sessions expire.