question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory-related error in R 3.2.4

See original GitHub issue

I created a large data frame in Python and saved it using write_feather. When I try loading it in R, R crashes with the following error:

> results <- feather::read_feather('results.feather')
R(7404,0x7fff78524000) malloc: *** error for object 0x10c4d3630: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

It makes no difference whether I use :: or load the package first.

However, when I reinstall feather and try to load results in the same R session, it works fine:

> install.packages('feather')
trying URL 'https://cloud.r-project.org/bin/macosx/mavericks/contrib/3.2/feather_0.0.1.tgz'
Content type 'application/x-gzip' length 649676 bytes (634 KB)
==================================================
downloaded 634 KB


The downloaded binary packages are in
    /var/folders/z6/mcdmp2d926bd5rh1825k1hnh0000gp/T//RtmpDBxipP/downloaded_packages
> results <- feather::read_feather('results.feather')
There were 15 warnings (use warnings() to see them)
> dim(results)
[1] 526595     50
> results <- feather::read_feather('results.feather')
There were 15 warnings (use warnings() to see them)
> dim(results)
[1] 526595     50
> warnings()
Warning messages:
1: Coercing int64 to double
2: Coercing int64 to double
3: Coercing int64 to double
4: Coercing int64 to double
5: Coercing int64 to double
6: Coercing int64 to double
7: Coercing int64 to double
8: Coercing int64 to double
9: Coercing int64 to double
10: Coercing int64 to double
11: Coercing int64 to double
12: Coercing int64 to double
13: Coercing int64 to double
14: Coercing int64 to double
15: Coercing int64 to double

And when I load a smaller data set first, I am able to load the large data set afterwards without a problem:

> metadata <- feather::read_feather('metadata.feather')
Warning messages:
1: Coercing int64 to double
2: Coercing int64 to double
3: Coercing int64 to double
4: Coercing int64 to double
5: Coercing int64 to double
6: Coercing int64 to double
7: Coercing int64 to double
8: Coercing int64 to double
9: Coercing int64 to double
10: Coercing int64 to double
> dim(metadata)
[1] 2885   60
> results <- feather::read_feather('results.feather')
There were 15 warnings (use warnings() to see them)
> dim(results)
[1] 526595     50
> warnings()
Warning messages:
1: Coercing int64 to double
2: Coercing int64 to double
3: Coercing int64 to double
4: Coercing int64 to double
5: Coercing int64 to double
6: Coercing int64 to double
7: Coercing int64 to double
8: Coercing int64 to double
9: Coercing int64 to double
10: Coercing int64 to double
11: Coercing int64 to double
12: Coercing int64 to double
13: Coercing int64 to double
14: Coercing int64 to double
15: Coercing int64 to double

The IRKernel in the Jupyter Notebook crashes hard when trying to load results.feather. When trying to load metadata.feather, the IRKernel sometimes returns the following error:

Error in coldataFeather(x, i): REAL() can only be applied to a 'numeric', not a 'NULL'

but I wasn’t able to replicate the error in general, and I’m currently using both data sets in the IRKernel without an apparent problem.

I get no errors or crashes in Python operating on this data.

System and package info:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.5
BuildVersion:   15F34
$ R --version
R version 3.2.4 (2016-03-10) -- "Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
$ Rscript -e "packageVersion('feather')"
[1] ‘0.0.1’
$ pip show feather-format

---
Metadata-Version: 1.1
Name: feather-format
Version: 0.2.0
Summary: Python interface to the Apache Arrow-based Feather File Format
Home-page: http://github.com/wesm/feather
Author: Wes McKinney
Author-email: wesm@apache.org
License: Apache License, Version 2.0
Location: /usr/local/var/pyenv/versions/rocketrip-datascience/lib/python3.5/site-packages
Requires: cython
Classifiers:
  Development Status :: 3 - Alpha
  Environment :: Console
  Programming Language :: Python
  Programming Language :: Python :: 2
  Programming Language :: Python :: 3
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3.4
  Programming Language :: Python :: 3.5
  Programming Language :: Cython

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hadleycommented, Aug 11, 2016

It’s unlikely to be directly a memory problem but instead a bug somewhere in the R code. Is there anyway you could share the file? (Or even better code that generates the file).

1reaction
hadleycommented, Aug 11, 2016

Have you tried the development version of feather? It’s likely to fix this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

R memory management / cannot allocate vector of size n Mb
Error messages beginning cannot allocate vector of size indicate a failure to obtain memory, either because the size exceeded the address-space limit for...
Read more >
R News - The Comprehensive R Archive Network
R CMD INSTALL and hence install.packages() gave an internal error installing a package called description from a tarball on a case-insensitive file system....
Read more >
GDCprepare() can never complete request ("Error
I have 16 Gb of RAM. I was suspecting having not enough, but it's strange that the error message says "vector of size...
Read more >
How to solve Error: cannot allocate vector of size 1.2 Gb in R?
I'm trying to normalize my Affymetrix microarray data in R using affy package. But, i get a warning Error: cannot allocate vector of...
Read more >
cuFFT API Reference - NVIDIA Documentation Center
Functions in the cuFFT and cuFFTW library assume that the data is in GPU visible memory. This means any memory allocated by cudaMalloc ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found