Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:27:22+00:00 2026-05-15T23:27:22+00:00

I am using R on some relatively big data and am hitting some memory

  • 0

I am using R on some relatively big data and am hitting some memory issues. This is on Linux. I have significantly less data than the available memory on the system so it’s an issue of managing transient allocation.

When I run gc(), I get the following listing

           used   (Mb) gc trigger   (Mb)  max used   (Mb)
Ncells   2147186  114.7    3215540  171.8   2945794  157.4
Vcells 251427223 1918.3  592488509 4520.4 592482377 4520.3

yet R appears to have 4gb allocated in resident memory and 2gb in swap. I’m assuming this is OS-allocated memory that R’s memory management system will allocate and GC as needed. However, lets say that I don’t want to let R OS-allocate more than 4gb, to prevent swap thrashing. I could always ulimit, but then it would just crash instead of working within the reduced space and GCing more often. Is there a way to specify an arbitrary maximum for the gc trigger and make sure that R never os-allocates more? Or is there something else I could do to manage memory usage?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:27:23+00:00Added an answer on May 15, 2026 at 11:27 pm

    In short: no. I found that you simply cannot micromanage memory management and gc().

    On the other hand, you could try to keep your data in memory, but ‘outside’ of R. The bigmemory makes that fairly easy. Of course, using a 64bit version of R and ample ram may make the problem go away too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using some Javascript to create a text field once an certain
I'm using this Big Integer library for Javascript: http://www.leemon.com/crypto/BigInt.js and I need to be
I have some quirky problems with IE7+ (yes big surprise) when trying to find
I want to open some relative big files (jpg, gif, bmp) using as little
I have some relatively complex sqlite queries running in my iPhone app, and some
I have a relatively simple case. I basically want to store data about links
I am relatively new to writing in C. I have self taught myself using
I'm doing some relatively simple I/O in Java. I have a .txt files that
I'm using PySide to manage some hardware and perform some relatively simple operations depending
I'm experimenting using the xmlgen library to generate some relatively simple xmd documents; however,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.