[ECOS] Stress testing JFFS2
Tue Oct 7 10:57:00 GMT 2003
Today stress testing JFFS2 came up on the agenda, and I wrote a small
piece that demonstrates a problem with JFFS2 running out of space
when it shouldn't, leaving a corrupt JFFS2 image and continuously
allocating more ram.
The test consists of writing lots of files that overwrite existing
files. The total number of files is never >16.
/config is a JFFS2 fs. 6*0x10000bytes.
Should I expect this sort of thing to never fail and to
reach a plateau of memory usage?
20-30k ram seems excessive for 16 files.
for (int i=0; i<10000; i++)
for (int j=0; j<(sizeof(name)-1); j++)
sprintf(nameBuffer, "/config/%s", name);
fd = open( nameBuffer, O_WRONLY|O_CREAT|O_TRUNC );
actual=write(fd, args, len);
struct mallinfo info;
info = mallinfo();
diag_printf("Created file %d %d bytes ram free\r\n", i,
Created file 0 153284 bytes ram free
Created file 100 149132 bytes ram free
Created file 200 146732 bytes ram free
Created file 300 144332 bytes ram free
Created file 400 141932 bytes ram free
Created file 500 139532 bytes ram free
Created file 600 137132 bytes ram free
Created file 700 134732 bytes ram free
Created file 800 132332 bytes ram free
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss