commands/leak/leak.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Thu, 26 Aug 2010 00:49:35 +0100
changeset 37 534b01198c2d
parent 31 d0e1c40de386
child 59 c9dfb364c2d1
permissions -rw-r--r--
Added ENotifyKeypresses and ECaptureCtrlC flags to CCommandBase. Commands can now get keypresses and handle ctrl-C via callbacks instead of having to implement custom active objects. As part of this extended the CCommandBase extension interface to MCommandExtensionsV2 for the new virtual functions KeyPressed(TUint aKeyCode, TUint aModifiers) and CtrlCPressed(). sudo now cleans up correctly by using ECaptureCtrlC.

# leak.cif
# 
# Copyright (c) 2010 Accenture. All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
# 
# Initial Contributors:
# Accenture - Initial contribution
#

==name leak

==short-description

A tool for purposefully wasting memory.

==long-description

Sits in a loop allocating memory. This continues until either the specified amount of memory has been consumed, or an error occurs. The allocations can be configured to come from a raw RChunk, or via an RHeap (C<User::ChunkHeap()>). The command waits for a keypress before exiting and freeing the memory.

==see-also

L<gobble|gobble>

==argument int amount optional

The target amount of memory to consume (in bytes). If not specified attempts to consumes all available memory.

==option bool v verbose

Display more detailed output.

==option int i increment-amount

The number of bytes to leak on each increment. If not specified and a target amount is specified, tries to allocate the entire target amount in one go. If not specified and a target amount isn't specified either, defaults to 4096 bytes. Note that unless C<--heap> is used, the increment amount must be a multiple of 4096 bytes.

==option uint r rate

The amount of time (in milliseconds) to wait between each increment. Defaults to zero (i.e. no wait).

==option uint a address

The address of a heap to leak into. The value should be in the address space of the process given by the C<--processid> option.

==option bool H heap

Use a ChunkHeap to consume the memory rather than a straight RChunk.

==option bool t retry

If specified, when an allocation fails retry using a smaller increment amount.

==option bool l logging-allocator

If specified, install the logging allocator before starting to leak memory. Assumes the C<--heap> option.

==copyright

Copyright (c) 2007-2010 Accenture. All rights reserved.