Blog

Trim SSDs through ioctl in Java/Scala

Trim Command is defined for SSDs to mask which data are discarded. This low level ATA command can be submitted from the user space by ioctl (see: Manually trim solid-state drivers (SSDs) in Linux).

Call system C function in Java/Scala

Low level system functions are often written in C/C++. You can use Java Native Interface to call the C/C++ code in Java. A more common way is to use system library, such as .so files in Linux and .dll files in Windows, in Java. Here is an example of how to add glibc functions in Java/Scala.

Limit the Physical Memory in Linux

Add the “mem=MEMORY_LIMIT” to the boot option, and reboot the system.

How to Clear Cache in Linux

It should be much more safer to sync the data to disk before clear the caches.

SBT/Scala tutorial

You can start to learn Scala from the official tutorial. A good Chinese page to learn Scala is here.

Manually trim solid-state drivers (SSDs) in Linux

By trimming your SSD, you may permanently lose your data. Please do with your own risk.

Lock-free Read/Write

Mutex Flag Define

BACI Ben-Ari Concurrency Interpreter

BACI is a concurrency simulator. jBACI is an integration of the original BACI compilers and Strite’s interpreter into an IDE that contains an editor, together with extensions to the GUI to simplify its use by novices. jBACI is only available for Windows.