ruby - PostgreSQL queries are gobbling up VM -
[Html>
[script: I know that there is nothing delayed: Not specific for the job but help to establish this context .]
Update
I believe SQL tricks are not being collected in garbage. My application creates many large SQL Insert / Update Operations (160k bytes each, about 1 per second) and sends them through PostgreSQL:
ActiveRecord :: base.connection.execute (My_large_query) When I execute these DB operations, my application increases without bound. When I reject DB operations (but do all other things in my app) then bloating stops.
So: Why is this happening, there is no idea about how I can fix it or how can I stop it?
The basic question
I have been delayed in such activities that linger the data from the web and make records in a PostGrace SQL database. They are working fine, but they start with vmemsize = 100 m, and in 10 minutes, in the bulk, the Wmmskez = 500m and just keep growing.
How can I tell where the memory is going?
Before you refer me to other such posts on this topic before I start beating MacBook Pro with 8G RAM. I have added the following for my #after (job) method:
def after (work) clss = [object, string, array, hash, ActiveWorld :: Base, ActiveWorks :: Relationships] clss.each {| Cls | Object_Report (CLS, "Pre-GC")} Object Space.Elect_Object (ActiveWorld :: Relation) .ECH (AND: RESET) GC Start CLS.EH {| CLS | Object_Reports (CLS, "Post-GC")} End DEF Object_Reports (CLS, msg) Log (Sprint ("% s:% 9d% s", msg, Object Space.e_elect (CLS). Count, CLS) This reports on usage on fundamental classes, explicitly Reserves ActiveRecord :: Relation Objects (recommended), clearly a GC (as suggested) , And how many objects / strings / arrays / hashes, etc. (like What is the price, any of those sections is growing significantly (are there other classes that I should see? But will not this figure be reflected in the number?)
I can not use it because I am running Ruby 1.9.
And there are other tools that I think I was running on Linux, but I'm on OS X.
update
I was afraid that all this is a red herring: to walk the long left, the job of each Ruby vmsize of about 1.2 GB (yes, that big, but with today's standards Not too big), then under 850 MB and then between those two values, the bubbles can not be contracted to grow on a large scale. My real problem was that I was trying to run more than four such processes on my machine with 8 GB RAM, all the available RAM After filling the hypoxia again went into swapping Running only four processes about fills available memory, so the system does not start swapping. No, still the problem - I did not allow the work to run for a long time: Jobs continued to grow (though slowly). Even after running only two external jobs, all VMs are consumed and my machine starts thrashing. I tried to run in production mode (thinking that god mode can cache things which are not free), but there is no difference in it.
Comments
Post a Comment