Spartan '14 Help
Back to Main or Home(J)

Memory FAQ

What does this error message mean?

There are 3 main memory related error messages that appear in Spartan. They are :
  • Unsuccessful malloc of ...

    The operating system will not allow Spartan to access more memory. The two most common causes for this error are

    • another process (i.e. another application such as a web browser) has taken up much of your system's memory,
    • the default memory limit is set too high

  • Total memory limit exceeded

    Spartan cannot run this job with the current memory limits. The most likely cause of this is that you do not have enough RAM in your machine. However, it is also possible that the memory limit is set incorrectly. Note that 32-bit Windows Operating Systems only allow 1.5 GB of RAM to be used by Spartan.

  • ..Increase MEM_STATIC..

    This signals that some internal estimation has gone wrong. Essentially the computational engine structured the memory one way, and then realized that it was wrong. Often, an appropriate value for MEM_STATIC=x will be suggested in the verbose output.

Setting Spartan's memory limits

Spartan checks the machine to see how much Memory is available. You can set the amount of memory a job can use from within Spartan. The place you do this is different on each platform.
  • Windows/Macintosh: In the job-limits dialogue. (Options/Preferences/Jobs/Memory Limits)
  • LINUX: The administrator must rerun the install utility (sp_install).

The default memory value is also unique for each type machine:

  • Windows: The available physical memory is determined via a system call. A minimum of 750 MB is always assumed to be available. The amount available can vary depending on what other applications are doing at the time. (Other tasks such as watching a DVD, surfing the internet, or running another Spartan molecule can use significant amounts of RAM.)
  • LINUX and Macintosh: (Amount of Ram - 32)/(Max. number of concurrent jobs) or 750 MB whichever is greater.
This memory limit can be overridden on a per job basis with the MEM_TOTAL=x keyword in the option line. (x is in units of MB) The maximum memory must be less than total physical RAM divided by the number of concurrent job. If running in parallel, the memory requirements must be divided again by the number of processes.

Suggested Memory Settings for Parallel Spartan Versions

When Spartan runs a job in parallel the memory is duplicated among each parallel thread. Thus the memory requirements increase linearly with number of threads/cores being used. For example a job which requires 1.5 GB of memory for a serial run, will require 6 GB of memory for when run on 4 cores. Keep this in mind when you are setting the memory requirements, or when buy memory for a multi-core machine.

Memory Requirements for Frequency Calculations

Frequency calculations use significantly more RAM than a geometry optimization. The more RAM, the better and quicker the calculation of second derivatives.

Memory Requirements for Semi-Empirical Calculations

While Semi-Empirical calculations take much less memory than ab initio calculations, however, requirements can add up for very large systems. As a rough approximation (only good to 1 digit)

memory usage in kB = 950*8*(N2)/1024

where N is the number of atoms.

If using the SM54 Cramer-Truhlar solvation method one can expect another 9*8*(N3)/1024 kB of memory allocated for the semi-empirical modification.

Memory Requirements for DFT Calculations

Memory is usually not a limiting factor in DFT calculations, since we use a direct method for the exchange calculation. The biggest arrays are linear in the number of atoms, and quadratic with the number of basis functions.

Memory Requirements for post-HF Calculations

While more memory is always better with the advanced (post HF) methods, the usual machine limits are the amount of available scratch disk space.

Return to Top

Memory Requirements for DFT Calculations

What are the disk requirements?

Return to Top

Common Questions

  1. Will increasing swap improve performance?

  2. Probably not. The most likely effect will be to slow down Spartan calculations dramatically. But if you know what you are doing, and are careful it can help.

    In the worst case scenario, you will increase your swap, and Spartan will think your machine has more RAM than it really does. Spartan will then use this "virtual" RAM. Spartan will run, but often the RAM required by Spartan will reside on the disk. Accessing the disk is many order of magnitudes slower than running in RAM, and the speed of Spartan will plummet. A similar problem can occur even if Spartan is using less than the total RAM in your system. If a Spartan job and another program such as a web browser, a java applet, or even another Spartan job are both trying to use the real RAM a thrashing of memory will occur.

    There is a case where increasing swap space may help, but since it is so easy to do something wrong be careful. If there are some bloated applications on your machine which are running, but you are not using them, yet you choose not to exit them, they will take up valuable space in memory; Memory which Spartan wants to use. The best thing to do is to quit these applications. But you can also increase swap in the hope that the OS will swap the applications you aren't using out of memory and let Spartan use the real RAM.

    When increasing swap it is very important to set the memory limits of Spartan to be less than real Memory in your system. Typical modern operating systems require a bare minimum of 500 MB of RAM to run. So the maximum memory should be:

    "Total RAM"/"Number of jobs running at the same time"/"Number of threads per job"
    front top

    Return to Top

  3. My job failed with an error about MEM_STATIC. What does this mean?

  4. In DFT calculations the algorithms used partition memory into two different regions. For discussion purposes let's call them 'STATIC' and 'HEAP' memory. There are times when the algorithm incorrectly predicts the amount of 'STATIC' memory. When this occurs you may get an error message in the verbose output asking for more memory. This can usually be fixed by adding the MEM_STATIC=xx keyword to the output where xx is in megabytes (MB). The default is usually on the order of 32 MB. It is important that this number is less than the total memory allocated in the machine. See the discussion on setting Spartan's memory limits.

    Note: This replaces the deprecated keyword MEMORY=yy where yy was in units of "double-words" (64-bits)
    Return to Top

Back to Main or Home(J)
Last modified: Thu Jun 20 10:47:57 PDT 2013