Feh / nocache

minimize caching effects
BSD 2-Clause "Simplified" License
554 stars 53 forks source link

Please support large files on 32bit #26

Open asgh opened 8 years ago

asgh commented 8 years ago

If you use cachestats or cachedel on a large file with a 32 bit build of the tool it says:

open: Value too large for defined data type

nocache runs, but actually does nothing, the file is still cached at the end.

I tried installing the 64 bit version of the tool, and running a 32 bit command but it says:

ERROR: ld.so: object '/usr/lib/nocache/nocache.so' from
LD_PRELOAD cannot be preloaded: ignored.

(If it matters this is version 0.9-2 on Debian.)

Feh commented 8 years ago

I don’t have a 32 bit system at hand to try this out. Could you recompile (make clean all) using the referenced commit and see if this fixes the issue? Thanks.

asgh commented 8 years ago

I tried it and cachestats and cachedel work. But nocache does not. Large files still get cached, while small ones do not.

Also, it's not a 32 bit system, just 32 bit programs inside a 64 bit system so you might be able to cross compile or install Debootstrap (if you are on Debian).

Feh commented 8 years ago

Okay, so it’s a first step. I’ll try compiling some 32 bit binary when I have the time. Meanwhile, as per the README, have you tried nocache -n 2 (or, for that matter, -n 4)?

asgh commented 8 years ago

Just (actually 2 days ago, but forgot to click the Comment button) tried -n, didn't change anything. (I don't need it with small files, so I didn't expect it to change anything.)

Fishkin commented 7 years ago

Regarding the original comment with the 64-bit error, the proper way to do this in a multi-arch system like Debian/Ubuntu/Mint (other distros have similar, but different directory schemes) is to just put the 32bit and 64bit nocache.so into /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu respectively. It will automatically pick up the "nocache.so" matching the architecture of the loaded executable on preload.

Hopefully now, it's easier to test this on a 64-bit machine. I don't know of other distros or what Feh uses, though, so you'll have to do a little digging then.

This is very useful to use with 32-bit programs like wine's and nocache (doesn't matter if system is 64-bit), so please consider it for large files if it's possible.

Of course, the LD_PRELOAD should not be the full path! But just "nocache.so", i.e.:

export LD_PRELOAD="nocache.so $LD_PRELOAD"

And after placing them manually don't forget to run sudo ldconfig :)

guillemj commented 5 months ago

@asgh Hey! Perhaps you could give the referenced PR a try to see whether that fully solves your issues?