<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How to Fix Erlang Out of Memory Crashes When Using Mnesia</title> <atom:link href="http://streamhacker.com/2008/12/20/how-to-fix-erlang-out-of-memory-crashes-when-using-mnesia/feed/" rel="self" type="application/rss+xml" /><link>http://streamhacker.com/2008/12/20/how-to-fix-erlang-out-of-memory-crashes-when-using-mnesia/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link> <description>Weotta be Hacking</description> <lastBuildDate>Tue, 24 Aug 2010 14:34:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com" /> <atom:link rel="hub" href="http://superfeedr.com/hubbub" /> <item><title>By: Jacob</title><link>http://streamhacker.com/2008/12/20/how-to-fix-erlang-out-of-memory-crashes-when-using-mnesia/comment-page-1/#comment-11</link> <dc:creator>Jacob</dc:creator> <pubDate>Thu, 08 Jan 2009 01:08:15 +0000</pubDate> <guid
isPermaLink="false">http://streamhacker.wordpress.com/?p=68#comment-11</guid> <description>Ulf, thanks for the info on dirty operations. I didn&#039;t know about the possible replication issues, which are definitely a big deal in certain environments.</description> <content:encoded><![CDATA[<p>Ulf, thanks for the info on dirty operations. I didn&#8217;t know about the possible replication issues, which are definitely a big deal in certain environments.</p> ]]></content:encoded> </item> <item><title>By: Ulf</title><link>http://streamhacker.com/2008/12/20/how-to-fix-erlang-out-of-memory-crashes-when-using-mnesia/comment-page-1/#comment-10</link> <dc:creator>Ulf</dc:creator> <pubDate>Wed, 07 Jan 2009 21:44:32 +0000</pubDate> <guid
isPermaLink="false">http://streamhacker.wordpress.com/?p=68#comment-10</guid> <description>Recommending dirty operations over transactions should come with a very big caveat: you change the semantics and forego safety, esp. if you have a replicated system. Dirty operations do not guarantee that replication works, for example. It may even work partially, given certain error situations, causing database inconsistency.I normally advice people to use mnesia:activity(Type, F) rather than mnesia:transaction(F), and to always start with real transactions, then measure and - only if really necessary (and safe!), switch to dirty where neeeded. This can then be done by just changing Type from &#039;transaction&#039; to &#039;async_dirty&#039;.In my experience, the &quot;iterate in small batches&quot; should be one of the first points. It is very good advice. Also, monitor ets and mnesia tables to see if they keep growing. Inserting temporary objects and forgetting to delete them is a fairly common source of memory growth.In other cases, a form of load control may well be what&#039;s needed, making sure that the system doesn&#039;t take on more work than it can handle (easy to do in an asynchronous environment). One very simple such device would be a gen_server that workers ask (synchronously) for permission before starting a new task. The server can monitor the &#039;run_queue&#039; to guard against cpu overload, memory usage, number of running processes, etc., depending on where your bottlenecks are. Keep it very simple.</description> <content:encoded><![CDATA[<p>Recommending dirty operations over transactions should come with a very big caveat: you change the semantics and forego safety, esp. if you have a replicated system. Dirty operations do not guarantee that replication works, for example. It may even work partially, given certain error situations, causing database inconsistency.</p><p>I normally advice people to use mnesia:activity(Type, F) rather than mnesia:transaction(F), and to always start with real transactions, then measure and &#8211; only if really necessary (and safe!), switch to dirty where neeeded. This can then be done by just changing Type from &#8216;transaction&#8217; to &#8216;async_dirty&#8217;.</p><p>In my experience, the &#8220;iterate in small batches&#8221; should be one of the first points. It is very good advice. Also, monitor ets and mnesia tables to see if they keep growing. Inserting temporary objects and forgetting to delete them is a fairly common source of memory growth.</p><p>In other cases, a form of load control may well be what&#8217;s needed, making sure that the system doesn&#8217;t take on more work than it can handle (easy to do in an asynchronous environment). One very simple such device would be a gen_server that workers ask (synchronously) for permission before starting a new task. The server can monitor the &#8216;run_queue&#8217; to guard against cpu overload, memory usage, number of running processes, etc., depending on where your bottlenecks are. Keep it very simple.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: streamhacker.com @ 2010-09-03 09:20:15 -->