[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(mgp-users 00539) using mgp for an automated slide show



I am using a slightly modified version of mgp for an automated slide
show.  The slides change automatically every <interval> seconds,
without someone touching a key.  The <interval> between the slides
is a command line parameter.  For instance "mgp -d 15" puts a 15
second wait between the slides.  Only mgp.c needed to be modified
for this purpose.  I have appended the diff file below.

My solution has a hidden problem, however.  I hope that someone
here can help me fix it.

The program has a substantial memory leak, which becomes evident if
the slides contain a lot of large graphics.  The memory usage steadily
increases until the program and the machine come to a grinding halt.
I have 128MB of memory.  The memory gets exhausted in half an hour,
at which time I have to kill mgp and start it over again :-(

I don't know enough about the internal workings of mgp to trace
memory leakage.  If you can provide me some help I would appreciate
it.

-- 
Rouben Rostamian <rostamian@umbc.edu>


Here is the output of "diff mgp.c mgp.c.org".  I am working
with the source mgp-snap-20010409.tar.gz

220c220
< #define ACCEPTOPTS    "Bd:vVob:c:eg:f:hlGp:qt:Q:PST:D:CORw:X:x:nF:E:"
---
> #define ACCEPTOPTS    "BdvVob:c:eg:f:hlGp:qt:Q:PST:D:CORw:X:x:nF:E:"
230d229
<                       demointerval = atoi(optarg);
417,424c416,420
<               while(1) {
<                       while (start_page <= maxpage) {
<                               state_goto(&state, start_page, 0);
<                               draw_page(&state, NULL);
<                               start_page++;
<                               sleep(demointerval);    /*XXX*/
<                       }
<                       start_page = 1;
---
>               while (start_page <= maxpage) {
>                       state_goto(&state, start_page, 0);
>                       draw_page(&state, NULL);
>                       start_page++;
>                       sleep(demointerval);    /*XXX*/
643,644c639
<       fprintf(stderr, "\t-d <interval>: Demo mode - go through the
presentation\n");
<       fprintf(stderr, "\t\twith <interval> seconds pause between slides\n");
---
>       fprintf(stderr, "\t-d: Demo mode - go through the presentation\n");