R
Railway16mo ago
321

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
Percy16mo ago
Project ID: 9299a946-e1da-4606-a612-1fcb1e2f0bdb
Brody
Brody16mo 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?
321
321OP16mo 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
Brody16mo ago
what caused that drop off in memory?
321
321OP16mo 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
Brody16mo ago
what do you mean closed processes?
321
321OP16mo ago
exiting/finishing/killing/stopping
Brody
Brody16mo ago
and how do you kill processes inside the railway container?
321
321OP16mo ago
its not cool, but it works
321
321OP16mo ago
one for windows and one for linux it works)
Brody
Brody16mo ago
so what specifically happens when the memory spikes?
321
321OP16mo ago
today it was not closed python loop, just mistake
Brody
Brody16mo ago
okay so problem solved?
321
321OP16mo 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
Brody16mo ago
a bug in your code, yeah railway runs your code as is after all
321
321OP16mo ago
if i attempt to reproduce it on my pc, there will not be such memory problems
Brody
Brody16mo ago
unfortunately your code not behaving the same in a different environment does not equate to a bug with railway
321
321OP16mo ago
total memory usage will decrease instantly, i think it's a right behaviour
Brody
Brody16mo ago
i recommend downloading nixpacks and docker and trying to reproduce this issue locally
321
321OP16mo ago
ok it's a good idea
Brody
Brody16mo ago
if you cant reproduce this with nixpacks and docker locally, then I will absolutely get the team involved for you
321
321OP16mo ago
i understand)
Brody
Brody16mo ago
keep me in the loop!
Want results from more Discord servers?
Add your server