Closed VinnyRadev closed 1 year ago
I'll try one more thing, keep both ParcelFileDescriptor, FileInputStream and FileChannel during the life cycle of object RandomAccessFileLollipop. I think it will solve the I/O bottleneck the application has with SAF (I think this is the cause of random freezes).
On Lollipop you open/close the file for each read operation. This has a big overhead on performance.
I'm not sure if it's related to this issue, but maybe keeping the objects pfd, fis & fileChannel cached in memory could help.
Understood, but I'm afraid it could lead to the same problem solved on this commit:
https://github.com/jhonathanc/ps3netsrv-android/commit/54c4be7768b449f10015330cf881dbf5a050f7b1
The main difference is I'll keep all necessary pointers in memory to avoid the GC to collect them. I'll create a new branch to let me merge this and check if the performance increased.
@VinnyRadev, could you please test this?
https://github.com/jhonathanc/ps3netsrv-android/suites/12932337059/artifacts/698689215
on the first try to start a game it did corrupt it.
on second start same game without refresh of xml and games ,it did load flawlessly
Is there any game that this issue is more noticeable?
@jhonathanc wouldn't be safer to use a try block when you create the fis object and when you read the file? The new code doesn't handle exceptions with the cached objects ;-)
@jhonathanc wouldn't be safer to use a try block when you create the fis object and when you read the file? The new code doesn't handle exceptions with the cached objects ;-)
On constructor, maybe... But on method "read", the exceptions are handled by the Commands, for example:
Ok. I asked, because the previous code used a try block. But if it considered in your logic, then it's fine.
Is there any game that this issue is more noticeable?
No. But it is always a PS3 game.
after more tests to reproduce it,it did happen with local hdd game. I'll close it as it may not be the apk at all.
Randomly when starting a game the PS corrupt.
a simple restart fix it until next time.