1

I ran an application on an Ubuntu instance of Amazon EC2, and it ran out of memory.

Here is what df shows:

ubuntu@ip-172-31-9-56:~/layers/punctuation$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev            16465276       0  16465276   0% /dev
tmpfs            3294652    8808   3285844   1% /run
/dev/xvda1       8065444 8049064         0 100% /
tmpfs           16473244       0  16473244   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs           16473244       0  16473244   0% /sys/fs/cgroup
tmpfs            3294652       0   3294652   0% /run/user/1000

My application stores a lot of large files in the /tmp folder, so I guess the /tmp folder is on /dev/xvda1.

There are other volumes which seem to have even more space.

  • What are you those volumes (tmpfs and udev)?
  • How can I access these volumes?
Yaron
  • 13,173

1 Answers1

1
  • tmpfs is a virtual memory filesystem based on your RAM
  • udev supplies Dynamic device management using virtual files

Those volumes aren't using actual disk, and can't be used for your needs.

Note: If you'd like to convert additional RAM and to use it as temporary disk-space (AKA RAM DISK), you can do it using the following command:

$ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs

While using part of your RAM as RAM DISK might work, it will consume that part of your RAM allocated as DISK and your programs won't be able to use it as RAM anymore.

You'll need to make sure that there is enough RAM left for your tasks/processing after you allocate that RAM DISK

In order to have more disk storage and still be able to use your RAM for your programs needs - the simple solution will be to add disks / use other machine with larger disk, or any other AWS solution for having additional disk-storage in your machine.


More info from Ubuntu Man pages:

man tmpfs:

NAME

   tmpfs - a virtual memory filesystem

DESCRIPTION

   The  tmpfs  facility  allows the creation of filesystems whose contents
   reside  in  virtual  memory.   Since  the  files  on  such  filesystems
   typically reside in RAM, file access is extremely fast.

   The filesystem is automatically created when mounting a filesystem with
   the type tmpfs via a command such as the following:
   $ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs

man udev:

NAME

   udev - Dynamic device management

DESCRIPTION

   udev supplies the system software with device events, manages
   permissions of device nodes and may create additional symlinks in the
   /dev directory, or renames network interfaces. The kernel usually just
   assigns unpredictable device names based on the order of discovery.
   Meaningful symlinks or network device names provide a way to reliably
   identify devices based on their properties or current configuration.
Yaron
  • 13,173