`
fly_hyp
  • 浏览: 305601 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

A JSP to print all the stacks

 
阅读更多

A JSP to print all the stacks

 

<%@ page import="java.util.*" %><%
    Map<Thread,StackTraceElement[]> map = Thread.getAllStackTraces();
    Set tt = map.keySet();
    Iterator<Thread> ti = tt.iterator();
    Thread thrd = null;
    final String br = "<" + "br" + ">";//website does not parse it
    try{

        int cnt = 1;
        StackTraceElement[] st = null;
        while(ti.hasNext() ){
            thrd = ti.next();
            out.print(br + "<" + "hr" + ">" + br + cnt + " \"" + thrd.getName());
            out.println("\", priority :" + thrd.getPriority()  + ", state :" + thrd.getState());

            out.print(", id :" + thrd.getId() + ", hex :" +  Long.toHexString(thrd.getId()) );
            out.print(" alive :"  + thrd.isAlive() + ", daemon :" + thrd.isDaemon() );
            out.print(" interrupted  :"  + thrd.isInterrupted() + ", daemon :" + thrd.isDaemon() );
            out.print(".\n" + br);
            st = thrd.getStackTrace();
            for(int sti = 0; sti < st.length; sti++){
                out.println(br + " &nbsp; &nbsp; " + st[sti].getClassName() + "." + st[sti].getMethodName());
                out.println("(" + st[sti].getFileName());
                if(st[sti].getLineNumber() < 1){
                    out.print("Native method");
                }else{
                    out.print(":" + st[sti].getLineNumber());
                }
                out.println(")");
            }

            out.println("");
            cnt++;
        }
    }catch(Exception e){
        out.println(br + "err " + e + br);
    }




%>

 

分享到:
评论

相关推荐

    Understanding stacks and registers in the Sparc architecture.doc

    在Sparc架构中,栈和寄存器是核心组件,理解它们的工作方式对于深入掌握这一处理器架构至关重要。Sparc架构由Sun Microsystems设计,以其灵活性和可扩展性著称,特别是V8版本。 首先,Sparc架构拥有32个通用整数...

    Guide to Data Structures_A Concise Introduction Using Java-Springer(2017).pdf

    This is followed by an introduction to linked lists and the implementation of stacks and queues using references. Next, there is an introduction to binary trees, a discussion of various • Chapter 1...

    Complete Guide to Open Source Big Data Stack-Apress(2018).pdf

    In the first chapter, I will provide a fuller introduction to the book architecture and chapter contents. I will describe the big data stack structure as well as extended topics such as scaling and ...

    Understanding stacks and registers in the Sparc architecture.pdf

    Peter Magnusson的文章《Understanding stacks and registers in the Sparc architecture.pdf》中可能详细解释了Sparc架构的栈和寄存器的工作原理、它们在程序执行中的角色以及如何通过编译器和汇编器进行管理和优化...

    Getting MEAN with Mongo, Express, Angular, and Node(Manning,2015)

    When you finish, you'll have all the skills you need to build a dynamic data-driven web application. What's Inside Full-stack development using JavaScript Responsive web techniques Everything you ...

    Eclipse IoT White Paper The Three Software Stacks Required

    《Eclipse IoT 白皮书:物联网架构所需的三个软件栈》是针对物联网(IoT)技术的一份深度研究报告,特别关注了构建物联网解决方案时必备的软件堆栈。这份白皮书由Eclipse基金会发布,该基金会是开源软件开发的重要...

    Data Structures using C++(OXFORD,2012)

    The book begins with a discussion on the fundamentals of data structures and algorithms, and moves on to the concepts of linear data structures, stacks, recursion, queues, and searching and sorting....

    Programming.Problems.in.Java.A.Primer.for.the.Technical.Interview.epub

    If you are preparing for an interview or want to challenge yourself, then this book will cover all the fundamentals asked at major companies such as Amazon, Google, and Microsoft. This book will ...

    7stacks 1.5Beta2

    这款小工具可以可以让Windows 7/Vista/XP拥有苹果系统里的stacks功能。使用后会在Windows 7的任务栏(Vista和XP系统则是快速启动栏)里增加一个指向特定文件夹的stacks图标,通过它可以对各种程序图标进行归类整理,让...

    C++ Crash Course- A Fast-Paced Introduction 2019.rar

    Part 2 introduces you to the C++ Standard Library and Boost Libraries, where you’ll learn about all of the high-quality, fully-featured facilities available to you. You’ll cover special utility ...

    深入java虚拟机(inside the java virtual machine)

    The Lifetime of a Java Virtual Machine The Architecture of the Java Virtual Machine Data Types Word Size The Class Loader Subsystem Loading, Linking and Initialization The Primordial Class ...

    Lecture_1_Introduction.pdf

    As a practical example, consider implementing a function named `PrintN` that prints all positive integers from 1 to N when given a positive integer N. Here’s how the function might look for different...

    微软内部资料-SQL性能优化2

    For a process to access 3 GB of address space, the executable image must have been linked with the /LARGEADDRESSAWARE flag or modified using Imagecfg.exe. It should be pointed out that SQL Server was ...

    Cracking The Coding Interview 5th Ed (高清版下卷)

    This is a deeply technical book and focuses on the software engineering skills to ace your interview. The book is over 500 pages and includes 150 programming interview questions and answers, as well ...

    Cracking The Coding Interview 5th Ed (高清版上卷)

    This is a deeply technical book and focuses on the software engineering skills to ace your interview. The book is over 500 pages and includes 150 programming interview questions and answers, as well ...

    Determining the stack usage of applications.pdf

    The developer aims to create a stable application, while not wasting resources. This application note explains methods that help finding the optimal setting while looking specifically on the stack ...

    Web Navigation

    One way to implement these features is to use two stacks to keep track of the pages that can be reached by moving backward and forward. In this problem, you are asked to implement this. The ...

Global site tag (gtag.js) - Google Analytics