diff --git a/tempsdb/chunks/base.pyx b/tempsdb/chunks/base.pyx
index 5c5aad8ed82be9f95e9cda8527dd06072b202233..4952a3cb7c97d76d8e71fcbaa37330c2308c6586 100644
--- a/tempsdb/chunks/base.pyx
+++ b/tempsdb/chunks/base.pyx
@@ -169,7 +169,8 @@ cdef class Chunk:
 
         if self.pointer >= self.page_size:
             # Inform the OS that we don't need the header anymore
-            self.mmap.madvise(mmap.MADV_DONTNEED, 0, HEADER_SIZE+TIMESTAMP_SIZE)
+            if hasattr(self.mmap, 'madvise'):
+                self.mmap.madvise(mmap.MADV_DONTNEED, 0, HEADER_SIZE+TIMESTAMP_SIZE)
         return 0
 
     cdef object open_file(self, str path):