Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing a large number of games kills process #24

Open
wizzomafizzo opened this issue Jun 18, 2023 · 11 comments
Open

Indexing a large number of games kills process #24

wizzomafizzo opened this issue Jun 18, 2023 · 11 comments
Labels
bug Something isn't working launchsync LaunchSync app

Comments

@wizzomafizzo
Copy link
Owner

When indexing an extremely large number of games on a system, app will exceed the amount of storage available in /tmp (ram) and get the process killed. This issue has been reported specifically with launchsync

@wizzomafizzo wizzomafizzo added bug Something isn't working launchsync LaunchSync app labels Jun 18, 2023
@jamescadd
Copy link

Is there a workaround?

@wizzomafizzo
Copy link
Owner Author

Not yet. I will take another look but I was not able to reproduce the issue reported yet

@aryko1872
Copy link

If it helps you reproduce, I'm seeing this issue using this sync file: https://raw.githubusercontent.com/aryko1872/mrext-launchsync-syncfiles/main/Arcade-15Khz-Horizontal.sync

@jamescadd
Copy link

I can repro this issue 100% of the time, is there anything I can do to help get it fixed? Maybe the db provider can be figured to automatically flush to disk, or to skip creating indexes until the entire db is populated, or something else easy to prevent the memory issue?

Alternatively, I would like to create the database file elsewhere (probably on RetroNAS) and drop it somewhere that the extensions like search would pick it up. Is it possible to move the database file to a share-mappable location like /media/fat/games and document the schema & provider needed for this scenario? I suppose there would also need to be a setting like "manual indexing" so that the indexer doesn't overwrite the file. Just an idea, open to anything that would fix the search REST API.

@wizzomafizzo
Copy link
Owner Author

I was still not able to reproduce this. But my best guess is that the indexing process is filling up the RAM with data. It's very basic, it just dumps a giant list of filenames to /tmp (in RAM) and then when the process is complete it copies that file to the SD card. The "db" file is just a gzip of text files splitting the filename lists up by system name.

I don't want to change it do straight to SD because this will dramatically slow down the process for everyone else. Maybe it could write to SD in chunks, say after each system, and clear out the /tmp usage each finished system. I don't know how much work that would be though, it could be pretty significant

launchsync doesn't even use a stored search.db file. It creates it on the fly each time it's run. So I'm not sure an option to specify its location will be helpful in this case. But I can look at adding it as an option

I'm not at home at the moment but I can revisit this in a couple weeks. I'm sorry it's been causing you all this trouble, it's a pretty tricky one to work out

@jamescadd
Copy link

No trouble at all, and thanks for the reply! Just a thought, but I've been wondering if there's another way to solve the problem of finding the file name to launch that would sidestep the issue of indexing.

For example, give people the option in settings that says "Enable HTGDB" and then assume their roms are at the locations provided in https://github.com/frederic-mahe/Hardware-Target-Game-Database (extensions can then download the dbs from the repo and search them instead).

Another approach might be to let people provide their own SMDB files, for example RetroNAS packs in SabreTools which can scan your library and create a SMDB of the files. People could upload their own in the web interface and bypass the built in indexing. I still do feel having RetroNAS perform indexing would be a valuable feature given its popularity, it seems like a thing Ansible can do though I'm not familiar with it.

@wizzomafizzo
Copy link
Owner Author

I finally fixed it
launchsync.zip

@thiagoauler
Copy link

That’s good news, Wizzo!! Thanks!!
One question:
This fix is available through update all, or for now we should manually install the zip provided??

@wizzomafizzo
Copy link
Owner Author

That’s good news, Wizzo!! Thanks!! One question: This fix is available through update all, or for now we should manually install the zip provided??

Right now use that zip but it will be fixed in the next released version too!

@aryko1872
Copy link

aryko1872 commented Mar 9, 2024 via email

@jamescadd
Copy link

@wizzomafizzo any chance we can have a release sometime soon so the lazy among us can try these fixes? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working launchsync LaunchSync app
Projects
None yet
Development

No branches or pull requests

4 participants