Skip to content

Share the tree between reads; give the server more memory (#177) - #178

Merged
jcombs-pointblue merged 2 commits into
mainfrom
memory-and-schema-reads
Oct 29, 2026
Merged

jcombs-pointblue merged 2 commits into
mainfrom
memory-and-schema-reads

Conversation

@jcombs-pointblue

@jcombs-pointblue jcombs-pointblue commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

For #177: a large project ran the server out of memory (OutOfMemoryError in AsCodeReader.read under VaultService.schemaClass and appSchema).

Reads share the tree

The schema and provisioning requests each read and parsed the whole tree from disk, and the schema page sends several at once.

  • TreeService.withModel(read): runs a read-only function on the outline's copy of the tree, under the service's lock (the DOM isn't safe for two threads). It calls Watcher.refreshNow() first, a walk of file sizes and times, so a change written a moment ago is read as before.

  • Moved onto it:

    • VaultService: schema, schemaClass, appSchema;
    • ProvisioningService: prd, form, catalog.

    Workspace wires both to the workspace's TreeService. Without it (tests), they read from disk as before.

  • Left alone: reads that change the model or work on a copy (compare, deploy, preview, simulator, Designer export). They don't run on every page view.

Memory

  • hosted/docker/bin/idmweb: starts Java with -XX:MaxRAMPercentage=75 (Java's default is 25%); IDM_JAVA_OPTS comes after, so -Xmx there wins. Checked in the image: a 2 GB container gives a 1.5 GB heap (was 512 MB), 8 GB gives 6 GB, and IDM_JAVA_OPTS=-Xmx1g gives 1 GB.
  • The first log line: ends with heap up to … MB.
  • Docs:
    • quickstart.md Day to day: what an OutOfMemoryError means, giving Docker more memory, or IDM_JAVA_OPTS=-Xmx4g in idmweb.env, which setup keeps;
    • hosted-install.md Operate: one line on the same.

The permissions warning

The third part of #177's log, hosted.properties is readable by other users on a Windows mount, is fixed in the core: PointBlueTechnology/DirXMLDev#116. This PR now pins DirXMLDev 0.59.0, which has it, and sets the version to 0.83.0.

Tests

  • SharedModelTest: two reads share one model; a file written without the watcher running is seen on the next read; VaultService and ProvisioningService read through it.
  • Suites: vitest 54, server 118, smoke.sh, smoke-hosted.sh, smoke-container.sh all pass.

🤖 Generated with Claude Code

jcombs-pointblue and others added 2 commits October 29, 2026 08:43
… memory

A large project ran the server out of memory (#177): the schema and
provisioning requests each read and parsed the whole tree again, and a page
sends several at once. They now read TreeService's copy under its lock,
checking the files first so a change written a moment ago is seen.

The launcher lets Java use 75% of the container's memory instead of 25%;
IDM_JAVA_OPTS (in idmweb.env) still overrides it. The first log line says
how much heap the server has, and the quickstart and hosted install say what
to do on an OutOfMemoryError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcombs-pointblue
jcombs-pointblue merged commit 238792b into main Oct 29, 2026
2 checks passed
@jcombs-pointblue
jcombs-pointblue deleted the memory-and-schema-reads branch October 29, 2026 13:52
jcombs-pointblue added a commit that referenced this pull request Nov 3, 2026
Share the tree between reads; give the server more memory (#177)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant