KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Reloading HDB causes "Cannot allocate memory" error Re: Reloading HDB causes "Cannot allocate memory" error

  • clivelo

    Member
    November 21, 2023 at 12:00 am

    Replying my solution in case someone else is experiencing this.

    I created a tiny subset of the data and tested in a barebone environment. Although the error didn’t occur, the mmap value was still non-zero (all HDBs I looked at had 0 mmap). As such, I suspected it was related to our setup of HDB that consumes mmap, and as the data grows, it will throw that error.

    Turns out we are using a segmented database and the segments are listed using a par.txt file. Importantly, the par.txt file must be in a standalone directory, but we put it in the root of the segmented database. Basically, when we loaded the HDB, it loaded the entire segmented database directly.

    https://code.kx.com/q4m3/14_Introduction_to_Kdb%2B/#144-segmented-tables

    The above should provide a good example of how the par.txt should be in a standalone folder, and how a segmented database should be structured.