Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to resolve "Op.sys refuses to provide memory"?

    Hi,

    I'm trying to open a .dta file of 2.35 GB size on Stata-64 version 14.2. I use a Windows 10 with 64 bit operating system, and 8 GB RAM.

    I'm getting the following error
    op. sys. refuses to provide memory
    Stata's data-storage memory manager has already allocated 1696m bytes and it just attempted to allocate another
    16m bytes. The operating system said no. Perhaps you are running another memory-consuming task and the command
    will work later when the task completes. Perhaps you are on a multiuser system that is especially busy and the
    command will work later when activity quiets down. Perhaps a system administrator has put a limit on what you
    can allocate; see help memory. Or perhaps that's all the memory your computer can allocate to Stata.
    r(909);
    I was not running any other task at that time. I use Stata-MP.

    Can someone help me out?

    Thanks

  • #2
    The error message is quite clear. Stata must load data into RAM memory, and when trying to do so, it ran out of space and complained. From your description, if you have 8 GB of memory, 6.3 GB are already used by things like Windows and other apps. If you have -preserve-d your dataset in your Stata session, this also counts towards your memory usage. The solution is to either reduce your memory footprint by closing apps, not using -preserve- before this step (or else immediately cancelling it by running -restore, not-), reducing your dataset to only necessary variables or adding more physical memory to your system.

    Comment


    • #3
      (Deleted, accidental near-duplicate posting.)
      Last edited by Mike Lacy; 14 Jun 2022, 21:12.

      Comment


      • #4
        As it happens, I have a 64-bit version of Stata 14.2 sitting on my machine, which has 8 GB of memory. I have a fair amount of other stuff in memory, too. Nevertheless, without any problems, I created, saved, and reloaded a file of approximately the size in question, using the following code:
        Code:
        clear
        set obs 300000
        forval i = 1/1000 {
         gen double x`i' = runiform()
        }
        One thing that's worth a try is to simply restart Windows, load Stata and no other programs, and see if the file can be read then.

        Comment

        Working...
        X