• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Would it be possible to write a servlet that output the current stack size?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

As the title suggests, I would like to develop a servlet which could output the current stack size at fixed time intervals. Is this feasible? Can anyone give me any assistance?

Thanks,

GM
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wouldn't the current stack size be local to the current running thread (if it were accessible at all. I don't know that it is)?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stacks are on a per-Thread basis and thus will always be the same for a request.

With Tomcat, I use the Management application to keep an eye on memory use.

Bill
 
Saloon Keeper
Posts: 28486
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt it. Although the popular conception of the stack is a linear area of memory that grows in one direction, a stack is actually a collection of frames that are linked together. It's efficient to acquire the memory for the next frame by augmenting a stack pointer, but there are other ways, and even in systems where a stack pointer is maintained thus, some implementations have been known to acquire a new chunk of frame storage from the heap when the existing frame chunk runs out of capacity.
 
Guy Leeds
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies. I'm at least getting a better understanding of how the stack(s) work.
 
reply
    Bookmark Topic Watch Topic
  • New Topic