R
Railway15mo ago
yaklovn

memory usage doesn't decrease

memory usage of one of my python processes was instantly increased to ~2700 mb, it was my mistake, but after finishing this process with -15 return code, memory usage of project in railway metrics was not decreased, and still ~2700 mb. in processes list from psutil (python package) memory usage is 400-500 mb. probably i cant see all processes, or there are problems in calculating memory usage for railway metrics. btw cp usage was decreased normally. only redeploy or [probably] restart will fix that. project cost is increasing too. there are no problems with smaller memory values, for example with ~200 mb it works fine, memory decreases instantly. service id: 9299a946-e1da-4606-a612-1fcb1e2f0bdb
23 Replies
Percy
Percy15mo ago
Project ID: 9299a946-e1da-4606-a612-1fcb1e2f0bdb
Brody
Brody15mo ago
first off, I would not blindly trust the output of a function chat gpt wrote and second, have you tried re-deploying this app?
yaklovn
yaklovn15mo ago
i trust this function because it produces realistic output in other cases. i can see 2000+ mb memory usage when a process with such usage is active. screenshots were taken at the same moment. ~50 mb difference, it can't produce a 2 gb difference redeploying or restarting the app helps, but it's not the best solution for me. i have something like apps/scripts manager, and i don't want to restart it every time i shut down a process that uses more than 2+ gb of memory i met this problem not for the first time. I've seen something like that before, but i thought it was my mistake
Brody
Brody15mo ago
what caused that drop off in memory?
yaklovn
yaklovn15mo ago
this happened a few minutes before the restart. in this moment i closed a few more processes that did not show crazy memory usage
Brody
Brody15mo ago
what do you mean closed processes?
yaklovn
yaklovn15mo ago
exiting/finishing/killing/stopping
Brody
Brody15mo ago
and how do you kill processes inside the railway container?
yaklovn
yaklovn15mo ago
its not cool, but it works
yaklovn
yaklovn15mo ago
one for windows and one for linux it works)
Brody
Brody15mo ago
so what specifically happens when the memory spikes?
yaklovn
yaklovn15mo ago
today it was not closed python loop, just mistake
Brody
Brody15mo ago
okay so problem solved?
yaklovn
yaklovn15mo ago
i think it is problem, because process is killed but memory is not free. for me this problem solved, but in future i can miss something like that and pay money i think it's a bug and it is main reason why i am here
Brody
Brody15mo ago
a bug in your code, yeah railway runs your code as is after all
yaklovn
yaklovn15mo ago
if i attempt to reproduce it on my pc, there will not be such memory problems
Brody
Brody15mo ago
unfortunately your code not behaving the same in a different environment does not equate to a bug with railway
yaklovn
yaklovn15mo ago
total memory usage will decrease instantly, i think it's a right behaviour
Brody
Brody15mo ago
i recommend downloading nixpacks and docker and trying to reproduce this issue locally
yaklovn
yaklovn15mo ago
ok it's a good idea
Brody
Brody15mo ago
if you cant reproduce this with nixpacks and docker locally, then I will absolutely get the team involved for you
yaklovn
yaklovn15mo ago
i understand)
Brody
Brody15mo ago
keep me in the loop!
Want results from more Discord servers?
Add your server