Skip to content

FATAL: could not create shared memory segment: Cannot allocate memoryΒ #43

@caminale

Description

@caminale

testing.postgresql Version

testing.postgresql==1.3.0
python 3.10
on MacOs M1

Debug Output

python3.10/site-packages/testing/common/database.py:40: in __init__
    self.cache = self.target_class(**self.settings)
python3.10/site-packages/testing/common/database.py:96: in __init__
    self.setup()
python3.10/site-packages/testing/common/database.py:125: in setup
    self.initialize_database()
python3.10/site-packages/testing/postgresql.py:104: in initialize_database
    raise RuntimeError("initdb failed: %r" % err)
E   RuntimeError: initdb failed: b'2023-02-03 09:50:29.610 CET [20851] FATAL:  could not create shared memory segment: Cannot allocate memory\n2023-02-03 09:50:29.610 CET [20851] DETAIL:  Failed system call was shmget(key=40827474, size=56, 03600).\n2023-02-03 09:50:29.610 CET [20851] HINT:  This error usually means that PostgreSQL\'s request for a shared memory segment exceeded your kernel\'s SHMALL parameter.  You might need to reconfigure the kernel with larger SHMALL.\n\tThe PostgreSQL documentation contains more information about shared memory configuration.\nchild process exited with exit code 1\ninitdb: removing contents of data directory "/var/folders/j6/d40048xdd118w7q8jz_7f2cc0000gn/T/tmpiyy6vqob/data"\n'

Expected Behavior

As a developper I expect no error about memory.

Actual Behavior

Several times a day I have a memory shared error, the lib cannot allocate memory. The only solution who solve my problem is to restart my computer.

  • I try to found a process to kill but I didn't find.
  • I try to delete the data directory but didn't resolve my problem.

Steps to Reproduce

I launch in debug mode and I kill the process then I have the problem.
Randomly sometime when a test in development crash then I have the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions