Question

Just I want to store a entire file in the tcl variable. So let me know, What is the the Storage Capacity of Tcl Variable ?

Était-ce utile?

La solution

Tcl has a current limit of 2 GiB (even on 64-bit systems, because of an old API botch in the type used for the size of entities) for the size of any “object” at the C level. For strings, this means that you probably need to stick to less than about 1 billion characters for safety (though the exact limit will vary depending on the details of what you are doing). For lists, on a 32-bit machine this limits you to about 500 million list items (provided you never get the string representation of the list) and the limit is half that on a 64-bit machine; you can use nested lists to work around this as the limit is just in the size of the underlying array. Dictionaries can probably go even larger, but I wouldn't recommend it (and probably can't go over 2 billion entries anyway because of the aforementioned API botch, though see the equally applicable comments relating to nesting).

You're also subject to the limits your OS and machine architecture imposes. Of course.

If you're working with very large data, you are strongly recommended to use Tcl 8.6.1 (or later) as that is better at doing soft failures from memory allocation problems.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top