Hi Jürgen,

At startup WikiEngine.initReferenceManager() builds a list with all the
Page and Attachment objects (getAllPages plus getAllAttachments) and passes
it to DefaultReferenceManager.initialize(). Those objects are metadata, not
the text. The text of a page is read only when the references are rebuilt,
which happens when the serialized reference data on disk cannot be read or
a page changed after it was saved. It is read page by page and not kept;
only the links are stored. So memory at startup grows with the number of
pages, but not with the size of their text. I have not measured it.



Arturo


On Sun, Nov 22, 2026 at 6:08 PM Jürgen Weber <[email protected]> wrote:

> DefaultReferenceManager.initialize(Collection<Page>)
> needs to load all Pages to build its references. I'd thought they're
> kept in memory.
>
> Am So., 22. Nov. 2026 um 17:18 Uhr schrieb Arturo Bernal (Jira) via
> dev <[email protected]>:
> >
> >
> >     [
> https://issues.apache.org/jira/browse/JSPWIKI-1363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149329#comment-18149329
> ]
> >
> > Arturo Bernal commented on JSPWIKI-1363:
> > ----------------------------------------
> >
> > Checked on master: the text of the pages is not all in memory. The page
> caches (renderingCache, pageCache, pageTextCache and the others) hold up to
> 1000 elements each by default (ehcache-jspwiki.xml), and
> CachingProvider.getAllPages() goes back to the provider when the wiki has
> more pages than the cache holds. What does grow with the number of pages is
> the reference graph of DefaultReferenceManager (which page links to which),
> kept in memory for all pages. I have not measured how many pages are needed
> to run out of memory. For the migration tool this means the tool should
> read and write page by page, as JP suggested, and not rely on getAllPages()
> staying cached.
> >
> > > Migration tool to convert from File based storage to a database based
> storage
> > >
> -----------------------------------------------------------------------------
> > >
> > >                 Key: JSPWIKI-1363
> > >                 URL:
> https://issues.apache.org/jira/browse/JSPWIKI-1363
> > >             Project: JSPWiki
> > >          Issue Type: New Feature
> > >            Reporter: Alex O'Ree
> > >            Priority: Minor
> > >
> > > seems like a good tool to generate with AI tooling and it would be
> useful for admins to have an option to migrate to a database for when the
> wiki starts to exceed the file system's capability
> >
> >
> >
> > --
> > This message was sent by Atlassian Jira
> > (v10.3.26#10030026)
>

Reply via email to