ToMemory[obj]
returns an in-memory version of the out-of-core object obj.
ToMemory
ToMemory[obj]
returns an in-memory version of the out-of-core object obj.
Details
- ToMemory is typically used to bring data into local memory, to allow more immediate interaction and analysis.
- Supported objects obj include:
-
otab out-of-core Tabular object audio out-of-core Audio object video out-of-core Video object - In-memory version of large objects increases the memory in use as well as the notebook size. It is generally not recommended to have in-core representation of very large objects.
- With inputs like Audio and Video, ToMemory performs the same operation as the "Store in notebook" button.
Examples
open all close allBasic Examples (3)
Create a Tabular object backed by a relational database:
tab = Tabular[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]] -> "offices"]ToMemory[tab]Perform operations on the SQL-backed Tabular object before bringing it into memory:
tab = Tabular[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]] -> "offices"]ToMemory[Select[tab, #country === "USA"&]]Store an out-of-memory Audio object in the notebook:
ToMemory@\!\(\*AudioBox[""]\)Scope (2)
a = Audio["ExampleData/car.mp3"]Inspect the out-of-core resource location:
Information[a, "ResourcePath"]This creates an in-memory Audio object:
ToMemory[a]Information[%, "ResourcePath"]v = Video["ExampleData/fish.mp4"]Inspect the out-of-core resource location:
Information[v, "ResourcePath"]The byte count of this out-of-core object is very small and does not increase with object size:
ByteCount[v]This creates an in-memory Video object:
mem = ToMemory[v]Information[mem, "ResourcePath"]Byte count of the in-memory version of the object is much larger and increases with larger resources:
ByteCount[mem]Properties & Relations (1)
Operations that are supported by out-of-core Tabular objects generally commute with ToMemory:
tab = Tabular[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]] -> "offices"]ToMemory[Select[tab, #country === "USA"&]] === Select[ToMemory[tab], #country === "USA"&]See Also
Related Guides
History
Text
Wolfram Research (2025), ToMemory, Wolfram Language function, https://reference.wolfram.com/language/ref/ToMemory.html.
CMS
Wolfram Language. 2025. "ToMemory." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ToMemory.html.
APA
Wolfram Language. (2025). ToMemory. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ToMemory.html
BibTeX
@misc{reference.wolfram_2026_tomemory, author="Wolfram Research", title="{ToMemory}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ToMemory.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_tomemory, organization={Wolfram Research}, title={ToMemory}, year={2025}, url={https://reference.wolfram.com/language/ref/ToMemory.html}, note=[Accessed: 13-June-2026]}