Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDKextendf does not free up memory when it fails due to insufficient resources #4013

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-05-24 14:31:12 +0200
From: @swingbit
To: GDK devs <>
Version: 11.21.1 (Jul2015)

Last updated: 2016-06-23 10:24:13 +0200

Comment 22173

Date: 2016-05-24 14:31:12 +0200
From: @swingbit

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36
Build Identifier:

I fired a cartesian product by mistake, which obviously failed with

GDK reported error.
GDKextendf: could not extend file
!OS: No space left on device
HEAPalloc: Insufficient space for HEAP of 6754142916608 bytes.
GDKextendf: could not extend file
!OS: No space left on device
HEAPalloc: Insufficient space for HEAP of 6754142916608 bytes.

The problem is that by trying this extend, the disk was filled up.
So I got back a prompt, like if nothing had happened, but an unusable system.

It only freed up the allocated space when I stopped and restarted the mserver5.

Can the so-far-allocated memory not be freed when this error occurs?
Even better, this was a cartesian product, no estimations involved, we know the size of the result before even trying to execute, shouldn't this fail before allocating any memory?

Reproducible: Always

MonetDB 5 server v11.21.20 (64-bit, 64-bit oids, 128-bit integers)
This is an unreleased version
Copyright (c) 1993-July 2008 CWI
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit for further information
Found 31.4GiB available memory, 8 available cpu cores
libpcre: 8.37 2015-04-28 (compiled with 8.37)
openssl: OpenSSL 1.0.1k 8 Jan 2015 (compiled with OpenSSL 1.0.1k-fips 8 Jan 2015)
libxml2: 2.9.2 (compiled with 2.9.2)
Compiled by: (x86_64-unknown-linux-gnu)
Compilation: gcc -O3 -pipe -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wunreachable-code -D_FORTIFY_SOURCE=2
Linking : /usr/bin/ld -m elf_x86_64

Comment 22184

Date: 2016-05-30 14:30:02 +0200
From: MonetDB Mercurial Repository <>

Changeset 57f925797ea1 made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=57f925797ea1

Changeset description:

Truncate file back to original size after failed extend.
This should solve bug #4013.

Comment 22185

Date: 2016-05-30 14:31:45 +0200
From: @sjoerdmullender

Fix is in Jun2016 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant