Received: from eggs.gnu.org ([208.118.235.92]:57822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0ziU-0000Ig-EJ for qemu-devel@nongnu.org; Mon, 13 Aug 2012 14:50:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0ziR-0002ks-EJ for qemu-devel@nongnu.org; Mon, 13 Aug 2012 14:50:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0ziR-0002kl-6f for qemu-devel@nongnu.org; Mon, 13 Aug 2012 14:50:15 -0400 From: Markus Armbruster References: <1344641050-21997-1-git-send-email-mdroth@linux.vnet.ibm.com> Date: Mon, 13 Aug 2012 20:49:26 +0200 In-Reply-To: <1344641050-21997-1-git-send-email-mdroth@linux.vnet.ibm.com> (Michael Roth's message of "Fri, 10 Aug 2012 18:24:10 -0500") Message-ID: <87lihibpah.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] json-parser: don't replicate tokens at each level of recursion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com Michael Roth writes: > Currently, when parsing a stream of tokens we make a copy of the token > list at the beginning of each level of recursion so that we do not > modify the original list in cases where we need to fall back to an > earlier state. > > In the worst case, we will only read 1 or 2 tokens off the list before > recursing again, which means an upper bound of roughly N^2 token allocations. > > For a "reasonably" sized QMP request (in this a QMP representation of > cirrus_vga's device state, generated via QIDL, being passed in via > qom-set), this caused my 16GB's of memory to be exhausted before any > noticeable progress was made by the parser. The command is here for > reference, and can be issued against upstream QMP to reproduce (failure > occurs before any qmp command routing/execution): > > http://pastebin.com/mJrZ3Ctg Commit messages are forever, pastebins aren't. What about preserving your test case for eternity under tests/? [...]