<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div>Hello Prof. Dr. Walther,<br><br></div>Thank you for the reply! "option[0] = 2" does fix the problem.<br><br></div>I ran the program with valgrind and it also reported multiple lines, such as:<br><div><br>==6462== Conditional jump or move depends on uninitialised value(s)<br>==6462==    at 0x4EDA8C1: traverse_unary (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4EDA8B0: traverse_unary (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4ED9754: nonl_ind_forward_safe (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4EF1696: sparse_hess (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4018DB: main (adolc_mem.cpp:61)<br>==6462==  Uninitialised value was created by a heap allocation<br>==6462==    at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>==6462==    by 0x4ED94C0: nonl_ind_forward_safe (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4EF1696: sparse_hess (in /usr/lib/x86_64-linux-gnu/libadolc.so.2.1.0)<br>==6462==    by 0x4018DB: main (adolc_mem.cpp:61)<br><br></div><div>but it does not run out of memory (outside valgrind).<br><br>"option[0] = 1" will also cause it to run out of memory in the first run.<br>Since the problem appears to be related with sparsity pattern evaluation, using option[0] = 0 or 1 with repeat = 1 after the first run does not run out of memory.<br></div><div><br><br></div><div>Best regards,<br><br></div><div>João Leal<br></div></div></div></div>