Open UWN opened 11 months ago
No such problem when using A^B#>27
instead of A^B#>9
in
?- between(0,1000000,N),([A,B]ins 0..3,A^B#>27,labeling([],[A,B]),false;N mod 10000=:=0,Countonly=true).
So far minimal leaking query:
?- between(0,1000000,N),(B in -1..0,-1^B#>9,B= -1;N mod 10000=:=0,Countonly=true).
N = 0, Countonly = true
; N = 10000, Countonly = true
; N = 20000, Countonly = true
; ...
; N = 170000, Countonly = true
; N = 180000, Countonly = true
; ^C error('$interrupt_thrown',repl/0).
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ulrich 938605 8.6 0.0 1742316 26812 pts/30 Sl+ 09:04 0:00 /opt/gupu/scryer-prolog/target/release/scryer-prolog -f -g use_module(library(between)),use_module(library(clpz))
ulrich 938605 72.9 0.0 1749312 34372 pts/30 Rl+ 09:04 1:15 /opt/gupu/scryer-prolog/target/release/scryer-prolog -f -g use_module(library(between)),use_module(library(clpz))
ulrich 938605 71.6 0.0 1750632 35692 pts/30 Sl+ 09:04 1:25 /opt/gupu/scryer-prolog/target/release/scryer-prolog -f -g use_module(library(between)),use_module(library(clpz))
$ sh -c 'ulimit -v 100000; ./scryer-prolog -f'
?- [user].
query :- repeat, _ is (2^64+1)-2^64, false.
?- query.
ulrich@p0:/opt/gupu/scryer-prolog$ sh -c 'ulimit -v 300000; time target/release/scryer-prolog -f'
?- repeat, _ is (2^64+1)-2^64, false.
thread 'main' panicked at 'out of memory', /home/ulrich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dashu-int-0.4.0/src/error.rs:15:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
memory allocation of 56 bytes failed
Command terminated by signal 6
2.70user 0.12system 0:13.18elapsed 21%CPU (0avgtext+0avgdata 58604maxresident)k
0inputs+0outputs (0major+14737minor)pagefaults 0swaps
Please note that this leak makes testing of clpz barely possible
@notoria's problems are gone, and the original problem now produces:
?- between(0,1000000,N),(B in -1..0,-1^B#>9,B= -1;N mod 10000=:=0,Countonly=true).
N = 0, Countonly = true
; N = 10000, Countonly = true
; N = 20000, Countonly = true
; ...
; N = 760000, Countonly = true
; N = 770000, Countonly = true
; memory allocation of 72 bytes failed
Aborted (core dumped)
ulrich@p0:~$ ulimit -v
300000