Folks - I'm stumped by this one, too (yet again) ...

I'm using TCP/IP, which means that I don't have much heap space free. What
I'm seeing is that periodically when I switch from form A to form B (which
means allocating various memory for form B), the application hangs for a
good while.

By hangs, I mean freezes, usually for about 30 - 60 seconds. When it's done
hanging, it responds to all the taps executed while hanging really fast.

My initial thought was that this is an allocation issue; the memory
manager's trying to compact the heap, which hangs things temporarily. What
makes it strange, though, is that I've put in lots of checks for free
memory (and contiguous free memory) and there doesn't seem to be a
determinate relationship between free or contig. free mem. and whether or
not it hangs.

I noticed that when I freed the memory for form A before loading and
launching form B, the hangs became less frequent. It seems like this
suggests that it's a memory issue, but if I can't get it to correlate with
the amount of memory, I can't very well do much about it (except for
generally tighter memory mgmt.)

Any idea what's going on here? I'm using NetLib periodically and cleaning
things up when I'm done (no server sockets or anything like that). My
memory usage (both free and contiguous free) stays fairly constant. After a
while, things start hanging, which isn't really acceptable for the final
application.

I've thought about trying this:

1. close NetLib, free all known resources (including globals), close down
all databases
2. call ::MemHeapCompact,
3. reopen everything I need

... when contiguous memory gets below a certain point. This would allow
MemHeapCompact to really do its work well. Unfortunately, I'm stumped as to
what point that would be, because there doesn't seem to be much of a
relationship.

Any help would be tremendously appreciated.

Thanks,
Ben Flaumenhaft

Reply via email to