Re: know of a memory "eating" utility?



try this program that I just wrote.

#include <stdio.h>
#include <stdlib.h>

int main( int argc, const char * argv[] )
{
if( argc <= 0 ) {
fprintf( stderr, "USAGE: memory.c memlength\n" );
exit( 1 );
}

char * mem = 0;
size_t length = atol( argv[0] );

if( length <= 0 ) {
fprintf( stderr, "invalid length specified" );
exit( 1 );
}

mem = malloc( length );
int i;

/* use memory constantly to avoid being swapped out. Never stop */
while( 1 ) {
for( i = 0; i < length; i += 100 ) {
mem[i] = i % 128;
}
}
}

.



Relevant Pages

  • porting problem
    ... Socket.h:47: parse error before `)' ... Socket.h:46: conflicts with previous declaration `int Socket::sending' ... Socket.cpp:33: ANSI C++ forbids declaration `memset' with no type ... Socket.cpp:38: ANSI C++ forbids declaration `exit' with no type ...
    (comp.unix.programmer)
  • [PATCH 72/79] sysdev: Pass the attribute to the low level sysdev show/store function
    ... return ppe_show_temp(sysdev, buf, 32); ... int val, rc; ... const char *buf, size_t count) ... container_of(dev, struct memory_block, sysdev); ...
    (Linux-Kernel)
  • Re: A code from M. Jerzy Buczynski
    ... #ifdef HAVE_ARPA_INET_H ... extern int h_errno; ... {const char **argvec; ... /* Socket opened saved. ...
    (comp.bugs.misc)
  • Re: A code from M. Jerzy Buczynski
    ... #ifdef HAVE_ARPA_INET_H ... extern int h_errno; ... {const char **argvec; ... /* Socket opened saved. ...
    (comp.bugs.misc)
  • A code from M. Jerzy Buczynski
    ... #ifndef HAVE_NET_SOCKET_H ... #ifdef HAVE_ARPA_INET_H ... extern int h_errno; ... {const char **argvec; ...
    (comp.bugs.misc)