Relevant Background Information
I created a small software that can be configured through a configuration file. The configuration file is analyzed and converted to the structure of the embedded environment (for example, .HIVE $ db = environment, .HIVE $ db $ user = "Horst",. HIVE $ db $ pw = "my password",. HIVE $ regex $ date = some regex for dates, etc.)
I created routines that can handle these nested environments (for example, look for the value "db / user" or "regex / date", change it, etc.). The fact is that the initial parsing of configuration files takes a lot of time and leads to a rather large volume of the object (actually from three to four, from 4 to 16 MB). So I thought: “No problem, let's just cache them, saving the object in .Rdata files.” This works, but “loading” cached objects causes my Rterm process to go through the roof regarding RAM consumption (more than 1 GB !!), and I still don’t understand why (this does not happen when I “calculate” the object all over again but that’s exactly what I'm trying to avoid, since it takes too much time).
I’ve already thought about maybe serializing it, but I haven’t tested it, since I needed to rework my code a bit. Plus, I'm not sure if this will affect the "download back to R" as well as the loading of .Rdata files.
Question
Can someone tell me why loading a previously computed object has such effects on the memory consumption of my Rterm process (compared to computing it in every new running process) and what is the best way to avoid this?
If desired, I will also try to come up with an example, but it’s a little difficult to reproduce my exact scenario. But I'll try.
performance caching memory r
Rappster
source share