Overall performance and memory allocation

Hi everyone!

It’s kind of a general question, but I hope you don’t mind to share your
thoughts with me :slight_smile:
I’ve noticed that frequent allocation/deallocation of relatively small
chunks of memory (64-512 bytes of paged pool)
may significantly (in times) decrease the overall system performance. At
least, that was my impression. Most
annoying part is that all this memory (most of the time) is used only within
one dispatch routine, so, theoretically,
the best place for it is the stack. But after a couple of bugchecks caused
by stack exhaustion (I didn’t use much
of it: 2-3K) changed my mind. So, a couple of question:

  1. What are dos and don’ts with regards to allocating temporary buffers on
    stack? Are there any recommendations
    and rules on how much of stack space can be utilized by FSD/Filters?
  2. If I consider using zones or lookaside lists (BTW, what would be better),
    how much memory I can claim (still being
    a good citizen)?

Thanks for all responds,