> top isn't actually a very accurate way of profiling memory usage. The
> numbers you have shown so far can easily be explained by memory
> fragmentation and the fact that glibc allocates memory in pools.
> Smaller memory fragments are not returned to the operating system but
> are being kept for reuse in the application. Please run your script a
> lot more often and see if there's a significant increase in memory.
> 
> 
> Sven

I have a test script that does the following:

Gimp::init;
my $img = gimp_image_new(300, 200, 0);
$img->gimp_image_undo_disable;

my $layer = gimp_layer_new($img, 300,200,RGB, "Layer 2", 100,
NORMAL_MODE);
gimp_image_add_layer($img, $layer, -1);
my $text_layer = gimp_text_fontname($img,-1,0,0,"111111111111", 0, 0,
14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer, CLIP_TO_BOTTOM_LAYER);
my $text_layer2 = gimp_text_fontname($img,-1,0,10,"2222222222222", 0, 0,
14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer2, CLIP_TO_BOTTOM_LAYER);
my $text_layer3 = gimp_text_fontname($img,-1,0,20,"3333333333333", 0, 0,
14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer3, CLIP_TO_BOTTOM_LAYER);
my $text_layer4 = gimp_text_fontname($img,-1,0,30,"44444444444444", 0,
0, 14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer4, CLIP_TO_BOTTOM_LAYER);
my $text_layer5 = gimp_text_fontname($img,-1,0,40,"555555555555555", 0,
0, 14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer5, CLIP_TO_BOTTOM_LAYER);
my $text_layer6 = gimp_text_fontname($img,-1,0,50,"66666666666666666",
0, 0, 14, 0, "Arial Bold");
gimp_image_merge_down($img, $text_layer6, CLIP_TO_BOTTOM_LAYER);

$img->gimp_image_undo_enable;
gimp_image_delete($img);

Gimp::end;

This script gets run 5000 times in a loop, and it's the only script
accessing the gimp instance.  I see no change in the perl-server and
script fu processes, but I do see an increase for gimp.  I'm not sure
how significant the increase is as I have to run the script quite a bit,
but this is what I see after running several loops and using top after
each loop:

Start up:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17632 7448  13m S  0.0  1.4   0:01.14 gimp 

Loop 1:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
21088  11m  13m S  0.0  2.2  11:45.59 gimp

Loop 2:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
25544  14m  13m S  0.0  2.9  23:28.40 gimp

Loop 3:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
27796  17m  13m S  0.0  3.5  35:11.54 gimp

Loop 4:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
31408  21m  13m S  0.0  4.2  46:54.84 gimp

Loop 5:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
35220  24m  13m S  0.0  4.8  58:35.12 gimp

Loop 6:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
38108  27m  13m S  0.0  5.5  70:11.92 gimp

Loop 7:
VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
42292  31m  13m S  0.0  6.2  81:51.41 gimp


Thanks,
Jared
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer

Reply via email to