question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"ran out of memory" checking spec with a large tuple

See original GitHub issue

Hello, I’m continuing development of my trace-checker. (We began discussion in #367, I’m following Ron Pressler’s method from “Verifying Software Traces Against a Formal Specification with TLA+ and TLC”.)

Currently, I have a Python script that parses a MongoDB log file and generates a TLA+ spec with a tuple of 6532 states. Each state is a tuple of variable values. Some of these values are large, including tuples up to 1014 elements long. The whole spec is 130MB of TLA+.

Here is the spec and config file.

TLC can parse this file, although it takes some time. The problem is this: TLC runs out of memory during model-checking. This surprises me, because there are only 6532 states. I increased the heap size to nearly the size of my physical RAM with -Xmx60g. That didn’t prevent the crash, it only delayed it.

TLC2 Version 2.14 of 10 July 2019 (rev: 0cae24f)
Running breadth-first search Model-Checking with fp 115 and seed 4672165855747705837 with 1 worker on 16 cores with 54613MB heap and 64MB
 offheap memory (Linux 4.15.0-55-generic amd64, Private Build 1.8.0_232 x86_64, MSBDiskFPSet, DiskStateQueue).
Parsing file /mirror/co/repl-trace-checker/Trace.tla
Parsing file /tmp/Integers.tla
Parsing file /tmp/Sequences.tla
Parsing file /tmp/Naturals.tla
Parsing file /mirror/co/repl-trace-checker/RaftMongo.tla
Parsing file /tmp/FiniteSets.tla
Parsing file /tmp/TLC.tla
Semantic processing of module Naturals
Semantic processing of module Integers
Semantic processing of module Sequences
Semantic processing of module FiniteSets
Semantic processing of module TLC
Semantic processing of module RaftMongo
Semantic processing of module Trace
Error: Java ran out of memory.  Running Java with a larger memory allocation
pool (heap) may fix this.  But it won't help if some state has an enormous
number of successor states, or if TLC must compute the value of a huge set.
Finished in 03h 52min at (2020-01-05 14:13:12)

Is there a way to diagnose why TLC needs so much memory, so I can determine a solution to the problem? Do you think I should use a different data structure rather than a tuple of tuples?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
lemmycommented, Jan 26, 2020

FWIW: Trace validation applied to a concurrent (Java) app: https://github.com/lemmy/BlockingQueue#v16-traces-print-partial-implementation-executions

0reactions
ahelwercommented, Feb 3, 2022

Hey @ajdavis it looks like the dropbox links are dead, is it possible for you to repost the specs somehow? Would like to see how the tree-sitter grammar fares on them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python will not release memory for tuple, will it? - Stack Overflow
I am currently working on solve a memory usage problem for my web service which running on google app engine. Does "use too...
Read more >
tla2tools build revision · Issue #406 · tlaplus/tlaplus · GitHub
(Extracted from issue #393) @alygin: Though I need to change its displayed version somehow, ... "ran out of memory" checking spec with a...
Read more >
Memory Management in Lists and Tuples
This article looks at lists and tuples to create an understanding of their commonalities and ... Let's check the memory allocated currently: ...
Read more >
Memory error checking in C and C++: Comparing Sanitizers ...
Debugging memory errors can be challenging, and having the right tool helps. See how Valgrind and Sanitizers compare for common C and C++ ......
Read more >
Solved: Out of memory while reading tuples
Solved: Hi! I have big report (200mb) and can't remove anything from a model (If I need to calculate something i used measures)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found