InMemoryEnv

42 views
Skip to first unread message

Lucas Lersch

unread,
Jun 22, 2016, 6:25:46 AM6/22/16
to leveldb
Hi,

I have noticed that there is an implementation of an In-Memory Environment in helpers/memenv. Is this supposed to be an alternative to the POSIX environment, but without durability guarantees?
Is it more like a "prototype" or it is safe to use it?
Finally, what would be the difference between an InMemoryEnv and a POSIX environment in a tmpfs or ramfs?

Best regards,
Lucas Lersch

Sanjay Ghemawat

unread,
Jun 22, 2016, 12:27:13 PM6/22/16
to lev...@googlegroups.com
On Wed, Jun 22, 2016 at 3:25 AM, Lucas Lersch <lucas...@gmail.com> wrote:
Hi,

I have noticed that there is an implementation of an In-Memory Environment in helpers/memenv. Is this supposed to be an alternative to the POSIX environment, but without durability guarantees?

Yes.
 
Is it more like a "prototype" or it is safe to use it?

Should be safe.  My understanding is that it is used in Chrome/Chromium (incognito mode?).  But I am not 100% sure.
 
Finally, what would be the difference between an InMemoryEnv and a POSIX environment in a tmpfs or ramfs?

Some differences I can think of:

(1) tmpfs lifetime is not bound to a process. So a leveldb running against tmpfs can pick up where it left off after a process restart (assuming machine hasn't rebooted; tmpfs hasn't been wiped).
(2) My guess is that InMemoryEnv will be a little faster since it requires no system calls to acces underlying data


Reply all
Reply to author
Forward
0 new messages