Comments (9)
I added cache cleaner that discard beatmap caches and history caches.
Old history data was wasting memory. They only needed to be kept for a short period of time, but they were kept permanently.
Cleaner will discard them every day.
Lobby#playersMap is also permanently retained, but since i have built the system on the assumption that this data will not be destroyed, safely destroying this data is a difficult task.
As an alternative approach, i changed the app to be launched by node instead of ts-node. This change should help to save some memory.
from osu-ahr.
Why don't you just enter things locally to a sqlite database, or even dare I say, a text file
from osu-ahr.
Why don't you just enter things locally to a sqlite database, or even dare I say, a text file
yup I've been thinking about this approach. Also I need to investigate this exception I've solved it on #47
C:\Auto Host Rotate\osu-ahr-master\src\webapi\BeatmapRepository.ts:53
throw new FetchBeatmapError(FetchBeatmapErrorReason.PlayModeMismatched);
^
FetchBeatmapError: PlayModeMismatched
at BeatmapRepositoryClass.getBeatmap (C:\Auto Host Rotate\osu-ahr-master\src\webapi\BeatmapRepository.ts:53:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async MiscLoader.checkMirror (C:\Auto Host Rotate\osu-ahr-master\src\plugins\MiscLoader.ts:92:15) {
isFetchBeatmapError: true,
reason: 2
}
from osu-ahr.
I tried running 3 rooms for 1 month straight. Got out of memory hahaha 💀 💀 💀
from osu-ahr.
Let me try run it without caching the map and I will report back in 1 month.
from osu-ahr.
This is the situation I was afraid of. I'll make it a top priority task when I'm able to write code.
from osu-ahr.
This is the situation I was afraid of. I'll make it a top priority task when I'm able to write code.
Yup, I've tried running it without using map as a cache for a day. This is my current implementation, we will see whether it can stay below 1GB memory in 2 weeks
async getBeatmap(mapId: number, mode: PlayMode = PlayMode.Osu, allowConvert: boolean = true): Promise<BeatmapCache> {
if (this.fetcher == WebApiClient) {
if (!WebApiClient.available) {
this.fetcher = this.websiteFetcher;
}
}
if (WebApiClient.available) {
/*
Ah damn I forgot to remove this line. 💀
That kinda explain why my network inbound traffic doubled on 1 day
*/
this.fetcher = this.websiteFetcher;
let cache = this.tryGetCache(mapId, mode, allowConvert);
if (cache) return cache;
const set = await this.fetcher.getBeatmapset(mapId);
if (set.availability.download_disabled == true || set.availability.more_information != null){
throw new FetchBeatmapError(FetchBeatmapErrorReason.NotAvailable);
}
this.cacheMaps(set);
cache = this.tryGetCache(mapId, mode, allowConvert);
if (cache) return cache;
throw new FetchBeatmapError(FetchBeatmapErrorReason.PlayModeMismatched);
}
else{
const set = await this.fetcher.getBeatmapset(mapId);
if (set.availability.download_disabled == true || set.availability.more_information != null){
throw new FetchBeatmapError(FetchBeatmapErrorReason.NotAvailable);
}
const now = Date.now();
for (const map of [...set.beatmaps ?? [], ...set.converts ?? []] as BeatmapCache[]) {
map.fetchedAt = now;
map.beatmapset = set;
map.failtimes = { exit: [], fail: [] };
//Simplify this
if(map.id == mapId){
if(map.mode_int == PlayMode.Osu.id){
if(mode == PlayMode.Osu || (mode != PlayMode.Osu && allowConvert)){
return map;
}
}
else{
return map;
}
}
}
throw new FetchBeatmapError(FetchBeatmapErrorReason.PlayModeMismatched);
}
}
from osu-ahr.
I tried my approach that I put above, it's still crashed because run out of memory. I will add more RAM to my virtual machine to avoid this problem.
from osu-ahr.
This issue has resolved from 6cd9055, thank you so much 😄 .
from osu-ahr.
Related Issues (20)
- Discord BOT HOT 2
- SyntaxError: Unexpected token , in JSON at position 145 HOT 3
- DISCORD BOT not responding to commands HOT 2
- discord token != empty HOT 2
- DM spamming HOT 3
- is it possible? If so, how? HOT 4
- reason? HOT 2
- Suggestion: Blacklist Maps Function
- I cant get the thing to start. HOT 3
- Help HOT 1
- please help what is an irc password? HOT 11
- when i start the git bash the console throw me this please help HOT 2
- Can't start the bot HOT 1
- hostkick_tolerance kinda unusable
- Add Chat Gpt Support
- Command HOT 1
- Disable LobbyTerminator HOT 1
- discord: use channel ids instead of creating channels
- Cannot parse config file: 'C:\Users\jaide\osu-ahr\config\local.json': SyntaxError: Unexpected token k in JSON at position 173 HOT 1
- The lobby closes all the time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osu-ahr.