[Feature] [Implementation] Alternative to Nested Vaults to Save on RAM resources

The above were two old posts of mine where I was struggling/trying to figure out how best to approach tablet work with lots of converted files in my new environment.

Since then, I know a little bit more.

Unfortunately, a large vault doesn’t really work a hundred percent well in the latest updated versions of Obsidian mobile, either. Not only does it take a long time to open the vault, the app has a way of exiting itself easily. Moderators think it’s the RAM (of an older device). I think there are some other issues there as well (possibly to do with folder structure and caching – I am no developer, of course).

So it came that almost a full year passed and I tried coming back to the original idea, namely cutting up the vault into smaller pieces (in my case, folders A-Z). An off-the-cuff half-hearted effort on my part looked like this:

In the hours that followed that post, at least I managed to find a working solution (which doesn’t need a jailbreak but it certainly makes it a little smoother).
Basically, after syncing (in my case: with GitHub) that is pulling data down, I move all my subfolders (now equipped with their own settings in their own .obsidian folders, which I set up on desktop) up one level so they’ll all be on the same root/vault level path (Obsidian on iOS only lets you do that): where the main vault sits.
One can do it using A-Shell (first accessing the Obsidian container with pickfolder-jump commands) and even automate it all with iOS shortcuts.
Then when the work on mobile is done, move all folders back to the main vault and now you can sync (in my case, I use git).

First I used the Filza (JB) app to do the moving but now I use the shortcuts (in my case, it was very easy because regex [A-Z] matched and took care of moving all my A, B, C…Z named folders).

In the meantime, I set up other shortcuts to access the temporary vaults and their files. The experience is really good. Switching vaults is really fast (moving a lot of files beforehand was equally really fast – don’t move files in the iOS Files app, that’s rubbish).

If you want to follow in my suit, I just need to remind you that first you need to set things up by creating the dummy folders (with the same name that your prospective subfolders have, obviously) in Obsidian, then quit Obsidian, delete the dummies (in Files app, if that’s what you have), then do the moving, and enjoy.

1 Like

As for the setup part, regarding creating dummy folders/vaults, it turns out to be not necessary; it was just a security measure on first try. Omit this step then.

Also, in A-Shell, if you pickFolder into your Obsidian vault, with pwd -P you can check and copy out the absolute path with the UUID and use that path to make moving folders smooth (rather than playing around with the jump command). So your shortcut would look something like this (this causes only one folder to be moved):

Then, as for moving back (to use your full vault again or in preparation for sync):

Amazing creative workaround solution!
I have found that on my iphone 11 with 4gb of ram, it helps when I let Obsidian play an empty 6h long audio file in the background.
It seems that iOS prioritizes apps that are playing audio when force closing apps to free up ram.
Here is a bit more detail: [Feature] Background sync - #33 by chrsle

PS: restarting the device once a week seems to help, and not running too low on storage space seems to help as well- although I don’t know how low is too low.

If it was your idea – I seem to remember it was – I tried it when you published it, but it didn’t work out for me.

In my case, the old girl is 2GB (1GB full ass) but as I said, I don’t think it’s solely a RAM issue.

Sorry to hear it didn’t work for you! Maybe 2 Gig is indeed too little.
Did you try both, audio and video? After running with it for a few weeks, the audio solution seems to be more reliable. Keep in mind, once you play any sound, Obsidian’s audio will he stopped. You can check that in tue control centre.
a good way of testing is by using a white noise file, e.g. from here: White Noise for Baby Sleep - Mp3 Download

1 Like

I only tried the video bit, but I’ll surely try the audio version as well. Thanks for the elaboration.

I just tested it on my old iPhone 6s with 2GB Ram, and it seems to work fine.
If it works for you too, you can use this 6h silent mp3 file: Dropbox - 6-hours-silence.mp3 - Simplify your life

Cheers, mate.

I’ll have a look into it tonight.

Didn’t pan out, I’m afraid. Two apps side by side – no. Pressing sleep button and coming back a half-minute later – again, it quit on me.

With my method, I can run apps simultaneously and have iPad sleep and come back to the previously opened (now smaller sub)vault.

I’ll try something else to ease my pain with the large vault in the coming days: delete cache (with jailbreak) and cut down on installed/activated plugins.

  • For me, Plugin Manager (you know the one) was more of a pain then help. I disabled it. There was no significant difference in the time plugins loaded at startup, yet once in the vault (and having Plugin Manager enabling the remaining plugins by the rules I set), I felt the interface heavier and more unresponsive than without using the plugin.

I don’t remember if it was plugin manager or plugin groups, but one of the two also didn’t do anything for me to reduce startup time. TfTHacker’s FastStart script however works really well.

I’m sure you know these already but just wanted to mention it: Taio and Notebooks can edit markdown in other folders on iOS. (I think 1Writer and iAWriter might be too.)

It’s a bummer that there isn’t a jailbreak tweak that enables keeping an app permanently in the background.

I used that script before; again, I didn’t detect any noticeable difference (my complete initialisation from pressing the vault button and arriving in it so I can start typing/searching takes 42-45 seconds, so 2-3 seconds is not much of a gain).

I used to be a bit of a Taio ambassador but now I use it less and less, mainly because my workflow with the Various Complements and Typing Transformer plugins necessitates my being in Obsidian. I like to learn my automatisms in one environment.

Also, I notified the Taio dev about a serious issue of duplicating lines in heavier documents – say 150-300 kbs – which also feel heavy in Obsidian mobile but the duplications inside the file don’t seem to come from Obsidian.

There is also MWeb on iOS which supports showing your images in editing mode but it only uses markdown formatting and you cannot click on links to navigate yourself in your vault, which you can do in Taio (which is not an Electron app and does not load your whole vault to be able to work).

So the problem here is basically Electron and the whole concept. Electron is very resource-heavy but I don’t remember having Chrome or Edge just quit on me like that on iOS – no matter how many tabs I had.

Also, I read that the more backlinks there are, the longer the load time. I have over 150.000 links. It’s all to do with the vocabulary-oriented/lexicon-like data entry not really suited for the app, but Obsidian is the best product I could find.

This method also makes it possible to move the complete (or part of the) vault to figure as a Logseq graph.

Spaces in folder and file names must be escaped by backslashes. %20’s and quotation marks didn’t work.

For example, for moving folder name 01 Home,

  • Works: 01\ Home
  • Doesn’t work: 01%20Home, "01 Home"

The method works well with the Obsidian Advanced URI community plugin (even when called outside of Obsidian, through Siri Shortcuts), which can target files at heading and block level as well.
Special characters in the full URL need to be double encoded, except for the space character (%20 is fine).
Files not present in the currently open vault can be called with the Obsidian Shortcut Launcher plugin from within Obsidian as well (you initiate the Siri Shortcut from within as you’d do normally with a share sheet). As I said, the easiest is to have these subvaults named A, B, C, etc., which will act as Vaultnames.

  • Single capital letters in initial position are easy to parse in the Shortcuts app and easy to move en masse (regex [A-Z]) with A-Shell.

I have now successfully set up a work environment where I can access any file (at any heading or block) in my main vault and not worry about Obsidian hogging too much RAM or exiting on me.

Another tip:
The [[Files#Headings]] (or blocks with ID’s) can be put into a custom dictionary of the Various Complements plugin (with as many aliases as you like as well!), which is really handy with finding otherwise elusive text blocks.

  • Run regexes on your vault in Notepad++, copy the results of your links with headings, run some regex replacements to equip your full links complete with headings and copy the results to a txt file you specify as your custom dictionary in VC.

In the end, I still went back to the original idea. One TEMP vault.

I have a Siri shortcut that moves over the markdown file along with each image corresponding to this file. This process could be done with A-Shell but since I have JB, I use a local SSH action with a full shell script I whomped together with the help/hindrance of a cheap chat robot.

I also have various WorkSpace shortcuts where a full array of pre-defined markdown files along with attachments images are moved over and I open the workspace with those files (with Obsidian Advanced URI).
So I can work with any file with any leading character (not like before, when I had to switch vaults) in any self-defined group/topic.

Then I have a shortcut that moves back all files from the TEMP vault to the Master Vault.
Should I want to go back to using one of my A-Z sub-vaults, I included a script in the MoveBackTemp shortcut which updates any plugin that has been upgraded while in the TEMP vault. Some plugins needed to be excluded from the sync.

  • With JB, one can install any command to be used in a Siri SSH action. Rsync, ripgrep, fzf, awk, etc.

The working experience is flawless, especially because I am using other plugins necessary to have a seamless interaction with files/references not yet in the TEMP vault. One of them is the Various Complements plugin.

  • Another subscript in MoveTempBack syncs my VC dictionary files to a folder in the Master Vault, so any new items I put in there would be available on PC as well. Of course, any changes made to these dictionary files on PC (if any) need to be synced back to the TEMP vault as well.

When I have done enough work for the day (I like resting my back and reading on and generally working with the iPad), I press one shortcut again that includes MoveBackTemp and syncs with GitHub. Again, I use SSH (and NewTerm).

The real solution: Buy an iPad with M1 chip.

It’s not about whether I should have a bigger gun. It’s about how to get better at clearing the target.

Especially because the issue is not about RAM (of an old device). For the past two days, I have been using my full/master vault on Obsidian on iPad with 19k files successfully (enough) – meaning I can put the device to sleep and continue using Obsidian straight away without it having quit on me and can multitask (use GoodReader or Safari and come back to the full vault to continue work).

I don’t know exactly what has changed since a few months ago (other than having to upgrade to iOS 15.7.6 and do a fresh restore/reinstall of everything after botching things up in the jailbroken state), but what I do know is enough not to let certain community plugins take part in my daily routine. (Some of those plugins even made my PC Obsidian freeze lately, actually: File Tree Alternative and TagFolder, for instance.)

The experience is still fragile. I cannot depend on its working reliably but it’s been better than ever before.
And again, I have to repeat myself: it is not about RAM per se. It’s about the app bloating up and breaking, possibly due to some internal processes being used by plugins. When you feel the device getting heated up, you know it’s struggling.

Anyone who says, it’s an old device and we cannot do anything about it is talking beside the point. It’s not about old devices (you can even install Obsidian on an Android tablet running 5.1) or RAM, it’s about the framework breaking easily.
Apart from stress-testing the app with nearly 20k files, I did not test the app with no plugins or snippets/themes installed, because I am too used to my setup.