Use the options alloc/free functions in tox4j.