Skip to content

cmsDumpExporter requires lots of memory #1715

Open

Description

@gollux

At IOI 2026, the final dump used more than 18 GB of RAM. This is way too much.

Activity

  1. pxsit commented on Sep 3, 2026

    @pxsit
    Contributor

    This issue also occurs with cmsDumpImporter

  2. prandla commented on Sep 3, 2026

    @prandla
    Member

    There's (at least) two separate problems here. One is that DumpExporter creates a bunch of temporary files, so if /tmp is on a tmpfs, this will inflate memory use. This should be relatively simple to fix.

    The other problem is that basically the entire database gets serialized into one json object, so it needs enough memory to store that object. This seems really difficult to fix with the current dump format. If we make a new format, then I guess using something like jsonl (i.e. just one json object per line) could alleviate the need to parse that much json at once, but then we still have to basically rewrite DumpExporter entirely (it relies on loading a lot of sqlalchemy objects in memory at once).

    At that point I wonder how much utility DumpExporter/Importer even have, as it is also possible (and much faster and more memory-efficient) to dump the database directly with pg_dump.

    How big was the IOI contest.json, by the way?

  3. gollux commented on Sep 4, 2026

    @gollux
    ContributorAuthor

    One advantage of using CMS dumps over database dumps is that you can dump and restore a single contest.

    This IOI's contest.json has about 10 GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions