Preparing to Run an Application

Normally you run applications by using the mm wrapper script supplied with Memory Machine. See Running an Application in Memory Machine. If you do not use the mm to run your application, you must set up the Memory Machine environment manually before running the application.

About this task

MemVerge recommends that you use the mm script to run unmodified applications. If you use the mm script to run your applications, you can ignore this section.

This task is for users who need to run an application in Memory Machine without using the mm wrapper script. To run an application standalone without the mm script, make sure you understand the Memory Machine architecture described in Introduction to MemVerge Memory Machine, especially as regards the Transparent Memory Service (TMS) and the Distributed Persistent Memory Engine (DPME). Then follow these steps:

Procedure

  1. Export MVMALLOC_CONFIG. For example:
    $ export MVMALLOC_CONFIG=/etc/memverge/mvmalloc.yml
  2. Optional: To avoid having to export MVMALLOC_CONFIG every time you open a shell, add the export command to the .bash_profile file so that MVMALLOC_CONFIG is set automatically. For example:
    MVMALLOC_CONFIG=/etc/memverge/mvmalloc.yml
  3. Export LD_PRELOAD. For example:
    $ export LD_PRELOAD=/opt/memverge/lib64/mvmalloc.so
  4. Optional: To avoid having to export LD_PRELOAD every time you open a shell, add the export command to the .bash_profile file so that LD_PRELOAD is set automatically. For example:
    LD_PRELOAD=/usr/lib64/mvmalloc.so
    Warning: If LD_PRELOAD is in scope, the Linux kernel always gives priority to the library that it indicates. Make sure you know the value of LD_PRELOAD in your run-time environment, or your application could allocate or deallocate unintended memory spaces.

    Adding the LD_PRELOD to bash_profile will use memory machine for EVERY program started from the CLI.

  5. Optional: An alternative to exporting LD_PRELOAD is to use LD_PRELOAD to start the application:
    $ LD_PRELOAD=/usr/lib64/mvmalloc.so app_name app_cl_parms
    where:
    app_name
    is the application CLI command
    app_cl_parameters
    are any command line parameters required by your application.
    In this case, LD_PRELOAD is set only for the application process iteself.

What to do next

After setting up the environment as described above, run your application as normal on the command line.