Commit graph

767 commits

Author SHA1 Message Date
Leonardo de Moura
cad379333d feat(util/memory_pool): put limit on the size of memory_pool free_lists
See #1405

Memory consumption is still high, but I didn't manage to cross the 2Gb
limit anymore with this commit even after hundreds of modifications.

@gebner I'm not seeing a big difference betwee Lean without memory_pool,
with bounded memory_pool and unbounded memory_pool. We may even consider
removing it in the future after a more careful benchmarking.

In the benchmark (https://gist.github.com/leodemoura/b27fb4203a13a67274b388a602149303),
I'm getting the following numbers:

- No memory_pool: runtimes between 3.532s - 3.556s

- With memory_pool bounded by 8192: runtimes between 3.32s - 3.44s

- With memory_pool (with no limit): runtimes between 3.32s - 3.44s

On the other hand, the small object allocator makes a big difference.
I used your list_rev.lean example.

- with:    2.62s
- without: 3.75s
2017-02-28 15:16:43 -08:00
Leonardo de Moura
db5b709d9c feat(CMakeLists,util): add CUSTOM_ALLOCATORS=OFF compilation option 2017-02-28 11:13:54 -08:00
Leonardo de Moura
ba641ce29f feat(CMakeLists,util): add TRACK_CUSTOM_ALLOCATORS=ON compilation option 2017-02-28 10:38:09 -08:00
Gabriel Ebner
7e3be51a52 chore(*): remove last remnants of mpfr 2017-02-24 21:42:58 +01:00
Leonardo de Moura
7eef501ae1 chore(*): remove mpfr dependency
closes #1380
2017-02-17 20:36:53 -08:00
diakopter
19606fd197 chore(util,kernel,library): clang warnings 2017-02-17 20:01:34 -08:00
Sebastian Ullrich
9d8c84713c refactor(*): reduce exception context info from expr to pos_info 2017-02-17 13:45:57 +01:00
Leonardo de Moura
e551b4ff09 fix(src/util/timer): uninit var 2017-02-13 18:15:01 -08:00
Leonardo de Moura
1306e56381 feat(library/vm): check heartbeat in function calls 2017-02-12 12:29:32 -08:00
Leonardo de Moura
7112f6d685 feat(library/tactic): add try_for tactic 2017-02-11 20:35:42 -08:00
Gabriel Ebner
d8c2be1a33 feat(shell/server): limit full message updates to once every 200ms 2017-02-10 09:01:55 +01:00
Leonardo de Moura
b13d0e1b4f chore(util/buffer): use std::move 2017-02-09 13:51:33 -08:00
Leonardo de Moura
01eb27d4a4 feat(util): "deterministic timeout" option
closes #1134

see #1362

This feature is implemented using a "hearbeat" thread local counter.
We reset the counter whenever we start a new task.
The counter is incremented when:

  1- An object is allocated using small_object_allocator (e.g., VM object)
  2- An object is allocated using memory_pool (e.g., expr, level, rb_tree nodes, list cons-cells, etc)
  3- check_system(...) invocations

We check if the threshold was reached at check_system.
The option --timeout=num can be used to set the limit (in thousands).
The default is unbounded in batch mode.
In server mode, the default is 100000. We can compile the standard library with --timeout=12000

I did not perform many experiments to check how precise this counter is.
I added a new Emacs configuration setting to change the server default.

Here is the wall clock time for different values of --timeout for the
command used on issue #1134

time ../../bin/lean -j 0 --timeout=20000 loop.lean
loop.lean:1:0: error: (deterministic) timeout detected at 'expression equality test' (potential solution: increase timeout threshold)

real	0m1.070s
user	0m1.032s
sys	0m0.036s

time ../../bin/lean -j 0 --timeout=40000 loop.lean
loop.lean:1:0: error: (deterministic) timeout detected at 'expression equality test' (potential solution: increase timeout threshold)

real	0m1.777s
user	0m1.676s
sys	0m0.044s

time ../../bin/lean -j 0 --timeout=50000 loop.lean
loop.lean:1:0: error: (deterministic) timeout detected at 'expression equality test' (potential solution: increase timeout threshold)

real	0m1.985s
user	0m1.920s
sys	0m0.056s

time ../../bin/lean -j 0 --timeout=100000 loop.lean
loop.lean:1:0: error: (deterministic) timeout detected at 'expression equality test' (potential solution: increase timeout threshold)

real	0m3.587s
user	0m3.564s
sys	0m0.020s
2017-02-07 13:56:12 -08:00
Gabriel Ebner
ea1e6bf3de feat(shell/lean): add default memory limit in server mode 2017-02-07 11:37:07 -08:00
Leonardo de Moura
5d3b889684 fix(util/lean_path): fixes #1339 2017-02-03 15:19:48 -08:00
Gabriel Ebner
94565113a6 chore(checker): remove gmp, mpfr, and dl library dependencies 2017-01-31 09:39:31 +01:00
Gabriel Ebner
61804eb8e9 chore(util/sexpr): remove mpz and mpq cases 2017-01-31 09:39:31 +01:00
Leonardo de Moura
6f502b9afd fix(library/vm): make sure vm_rb_map objects can be stored in ts_vm_obj
See discussion at #1337
2017-01-26 15:58:11 -08:00
Leonardo de Moura
1d98192071 fix(util/rb_tree): bug at equal_elems
This commit also adds an iterator class to rb_tree and rb_map.
2017-01-23 14:04:26 -08:00
Gabriel Ebner
a230c47178 feat(util/task_queue,emacs,*): highlight running tasks with different background color 2017-01-17 17:10:37 -08:00
Leonardo de Moura
fbc5f7a5fa chore(util/lean_path): compilation warning 2017-01-13 07:36:24 -08:00
Sebastian Ullrich
e4ec1808f3 fix(util/lean_path): find_imports: .olean files and default modules 2017-01-13 07:34:54 -08:00
Sebastian Ullrich
7e67b48b2d chore(util/name): avoid parameter name confusing CLion
The overloading of `name` makes it error out on the _entire_ remaining file.
2017-01-11 15:27:37 +01:00
Sebastian Ullrich
3ae4d0fbee feat(shell/completion,emacs/lean-company): provide doc string and location with completion candidate 2017-01-10 16:19:32 +01:00
Sebastian Ullrich
7040844f9a feat(frontends/lean/parser,shell): complete imports 2017-01-06 14:02:31 -08:00
Leonardo de Moura
738fb0a535 feat(util/rb_tree): improve merge 2017-01-05 20:35:45 -08:00
Gabriel Ebner
bc09a53f71 feat(library/task_queue): add flag to prevent priority inversion 2017-01-05 18:09:28 -08:00
Gabriel Ebner
db7c9f245d chore(CMakeLists): remove unused modules 2017-01-05 18:08:59 -08:00
Leonardo de Moura
d784aba249 feat(library/tactic/smt/hinst_lemmas): change how transparency is used to process hinst_lemmas 2017-01-04 19:12:37 -08:00
Gabriel Ebner
f6b8eb6821 feat(util/task_queue): lazy tasks 2017-01-04 16:30:22 -08:00
Leonardo de Moura
d7e894d197 fix(util/rb_tree): typo 2017-01-01 10:38:41 -08:00
Leonardo de Moura
35cc334b10 feat(library/init/meta): smt_tactic skeleton 2016-12-31 18:22:23 -08:00
Gabriel Ebner
6fa246032f fix(library/native_compiler): get_exe_location does not exist on emscripten 2016-12-31 15:15:20 +01:00
Sebastian Ullrich
c9a8c02fdc feat(emacs,frontends/lean/parser,shell/server): more accurate info command using server-side parsing 2016-12-27 10:07:34 -08:00
Leonardo de Moura
7e0612306f fix(util/file_lock): issue on Windows 2016-12-20 14:16:58 -08:00
Gabriel Ebner
a2bc967fac feat(library/module): reuse pre-imported init module 2016-12-20 10:15:19 -08:00
Gabriel Ebner
d89512b6fc fix(util/task_queue): fix undefined behavior with null references 2016-12-15 09:48:57 -08:00
Gabriel Ebner
a972c13ce9 refactor(library/task_queue): move task queue to util 2016-12-12 10:01:34 -05:00
Gabriel Ebner
02b4fe771f fix(util/message_definitions): initialize version field 2016-12-12 09:45:07 -05:00
Gabriel Ebner
bc74a79ebd refactor(library/message_buffer): extract definitions into extra header file 2016-12-12 08:56:15 -05:00
Gabriel Ebner
51821bd8c9 fix(util/thread): do not initialize thread_finalizers_manager in multiple threads 2016-12-08 13:11:40 -08:00
Leonardo de Moura
7b63d6566f fix(util/dynamic_library): throwing exception inside destructor may crash application 2016-12-08 07:16:43 -08:00
Leonardo de Moura
4ef901abb4 chore(src/util/dynamic_library): fix style warning 2016-12-06 15:25:41 -08:00
Leonardo de Moura
6684cd40ea fix(util/dynamic_library): Windows issue 2016-12-05 17:16:48 -08:00
Leonardo de Moura
e59515df5f chore(*): fix style 2016-12-05 16:39:58 -08:00
Jared Roesch
e65d90ac79 feat(*): C++ code generator
in progress move of Lean.native to init
2016-12-05 16:11:41 -08:00
Gabriel Ebner
570d905282 chore(util/thread): do not import chrono twice 2016-12-05 12:57:15 -05:00
Leonardo de Moura
c77a987b4d feat(util/thread): handle thread creation/join failure on Windows 2016-12-05 09:53:41 -08:00
Leonardo de Moura
612cde33b6 feat(util/thread): lthread for Windows 2016-12-05 09:42:21 -08:00
Leonardo de Moura
80d247eaff fix(src/util): make sure thread stack size is > LEAN_STACK_BUFFER_SPACE 2016-12-03 12:05:01 -08:00