Hi,

  Thanks, JP. I ran MemoryProfiling on master-2.x (commit 82e81a744) with
Java 17.0.20.1 and Maven 3.9.16, using the profile command from your 2022
mail (mvn test -Dtest=MemoryProfiling -pl jspwiki-main -am). master-2.x
needs Java 11 or newer, so Java 8 is not an option. jamm is 0.4.0. This is
the exact output of a
  single run:


   -   Plain Engine, without pages/attachments, search indexes, references,
   etc.: 6,139,344 bytes
   -   Engine, with default set of wiki pages: 6,130,864 bytes
   -   Page: -8,328 bytes
   -   Attachment: -8,264 bytes
   -   Guest session on plain engine: -7,944 bytes
   -   Acl: 104 bytes
   -   Acl entry: 112 bytes


  I would not trust the difference between the first two numbers. The
engine with the default pages came out smaller than the plain one, and the
Page, Attachment and session values are negative. I did not find out why.

  On master (jakarta) with Java 17 the test does not run. The first
measureDeep call fails with NoClassDefFoundError:
javax/transaction/TransactionManager. With javax.transaction-api 1.3 added
as a test dependency it fails with CannotAccessFieldException for the field
arg$1 of java.lang.ProcessHandleImpl$$Lambda,
  caused by "can't get field offset on a hidden class". Opening java.base
packages with --add-opens did not change it. I did not try a newer jamm.

  cheers,
  Arturo

On Mon, Nov 23, 2026 at 8:01 AM Juan Pablo Santos Rodríguez <
[email protected]> wrote:

> Hi!
>
> FWIW, JSPWiki memory consumption can be estimated, see
> https://lists.apache.org/thread.html/cqppw3bmgmthr86718yrhtz93kw3d2h1
>
> In 2022 that test gave almost 5MB for a complete Engine, 5.5MB with the
> default set of wikipages. It should probably give a higher number now, but
> shouldn't be too much. Anyone interested, please give that test a drive and
> share your numbers :-)
>
>
> cheers,
> juan pablo
>
>
> El lun, 23 nov 2026, 6:32, Arturo Bernal via dev <[email protected]>
> escribió:
>
>> 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