How to find out the number of threads created under java vm at runtime
our application seems to have hit the max number of threads that can be created under vm and the vm will just hang after that. that behavior seems to be consistent from an article that I read earlier.
I wonder any way that java app can find out the number of threads currently created under vm?
thanks in advance!
If you are not starting an extra thread group you can use the Thread.activeCount method. But this willnot return all the threads, as there are some jvm threads, i.e. garbage collector. Also if you are running on a Unix type operating system then you can send a signal to the jvm to give you a thread dump, i think the signal is sighup.
If the application is hanging i would of thought that you have a deadlock situation rather then the JVM not being able to create new threads, roughly how many threads should be running ??
Similar Messages
-
How to find out the Number range object for Incident number
How to find out the Number range object for Incident number ?
CCIHT_IAL-IALID
regards,
lavanyaHI, an example.
data: vl_num type i,
vl_char(6) type c,
vl_qty type INRI-QUANTITY,
vl_rc type INRI-RETURNCODE.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZRG0000001'
QUANTITY = '1'
SUBOBJECT = ' '
TOYEAR = '0000'
IGNORE_BUFFER = ' '
IMPORTING
NUMBER = vl_num
QUANTITY = vl_qty
RETURNCODE = vl_rc
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
vl_char = vl_num.
write vl_char.
Regard -
How to find out the number of songs in my iTunes 11 library
How to find out the number of songs in my iTunes 11 library
Welcome to the Apple Support Communities
To see the number of songs, go to View menu > Show Status Bar, so the number of songs you have will appear at the bottom of the iTunes window -
How do find out the number of rows
how to find out the number of rows of as all tables in a schema with one sql statement
Hi,
What u can try doing is...
declare
numrows number;
begin
for i in (select tname from tab)
loop
execute immideate 'select count(1) into numrows from ' | | i.tname ;
dbms_output.put_line(numrows);
end loop;
end;
Hope this helps. This works only in 8i. So if u need to do the same in 8.0 u have to use dbms_sql pkg.
The logic is same but the way u open ands execute the code is a bit diff.
Best Of Luck.
Regards,
Ganesh R -
How to find out the number of fields in generated proxy structure?
Hi All,
Can anybody help me to find out the number of fields in generated proxy structure in back end system along with controller fields.
i know how to get number of fields in XI system but i want the number of fields in back end system when we generate proxy including automatically generated controller fields.
Thanks in advance.
Regards,
UjwalkumarU mean u want to know at runtime?
Get the output from ur proxy as a string, count the number of "<" characters and divide it by 2. :-P
Of course, you'll have to treat the header fields separately.
Regards,
Henrique. -
How to find out the user who has created a new field in the custom table.
How to find out the user details who has created a new field in the custom table.
Thanks,
JoanHi Jesudasan ,
You can know the user details with version management.Please find the
below procedure to know.
Go to table->Utilities tab->version->Version management->Compare the previous one .
Hope this solves the issue,Let me know if you have any issues.
Thanks,
Rajani -
How to find out the user list that created by someone?
Hi all:
Now I want to develop a program that can find out the user list created by someone.
such as :
John create 3 user in SAP ,they are u1,u2,u3.
Susan create 2 user in SAP , they are s1,s2.
I input the the parameter such as John , the program can give me the list :u1,u2,u3.
Could you tell me which table should I use in this program?
Thanks .
Elisa.Hi Ling,
As per my understanding, you are looking for listing down the number of Users created by a particular users of the System. Like a System Administrator has created some 30 users. If this is correct, then you can use the table
USR02 - Logon Data (Kernel-Side Use). This table has 2 fields which are of importance - BNAME - User Name in User Master Record & ANAME - Creator of the User Master Record. You can query the ANAME with the username of the system and you will get the resultant users.
But I would reccomend to search the Table for a standard class, function module or RFC or BAPI so that you can reuse the same and need not to develop from the scratch.
Hope this will help.
Thanks,
Samantak. -
How to find out the version of JDBC driver in Java?
Hi all,
I would like to use Java to find out the version of JDBC driver that I currently use. That JDBC driver is from Oracle and the filename is "classes12.zip" for all version ( 8.1.x to 9.x ). Is any method to verify what version JDBC I currently use? Thanks a lot.DatabaseMetaData.getDriverVersion()
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html#getDriverVersion() -
Java Comiler - How to find out the Number of lines of Executable code
Hello,
Is there any option we have or could have to get the "Number of Lines of Executable Code" while we run the java compiler?
Technically Java is an interpreter. So in case the term is incorrect, please excuse me.
Since the compiler anyway traverses through the Java files, it is easy and correct to get the number from the compiler rather than having any external tool calculating the same.
It should remove the comments, blank lines and take care of java single sentence written in multiple lines.
Any suggestions or help is highly appreciated.
regards,
SabyasachiHow many lines of code are there in this program?
public class sabre20110211 {public static void main(String[] args) {for (int i = 0; i < 10; i++)System.out.println(i);}}And how many in this program?
public
class
sabre20110211
public
static
void
main(
String[]
args
for
(int i = 0;
i < 10;
i++
System.out.println(i);
} -
How to find out the number of occurence of special character
Hi ,
I have a string coming coming in I/p which is like '1;2;100;201;'
I need to break up this string and run my process for each value ( i.e for 1,2,100 and 201).
How i can know the count of number of occurences of ';' character?
How i can loop so that it runs once for each value?1. Split, pre Oracle 10g...
===========================
with t as (select '10,aaaa,20,vvvvv,30,xxx''xx,12,12,56' txt from dual)
select substr( txt
, decode(level, 1, 1, instr(txt, ',', 1, level-1)+1)
, decode(instr(txt, ',', 1, level), 0, length(txt), instr(txt, ',', 1, level)
- decode(level, 1, 0, instr(txt, ',', 1, level-1))-1)
) val
from t
connect by level <= length(txt)-length(replace(txt,','))+1
VAL
10
aaaa
20
vvvvv
30
xxx'xx
12
12
56
9 rows selected.2. Split, 10g onwards using regular expressions
===============================================
with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual)
-- end of sample data
select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
from t
connect by level <= length(regexp_replace(txt,'[^,]*'))+1
REGEXP_SUBSTR(TXT,'[^,]+',1,LE
aaaa
bbbb
cccc
dddd
eeee
ffff
7 rows selected.example usage with varying IN clause...
SQL> ed
Wrote file afiedt.buf
1 select *
2 from emp
3 where ename in (
4 with t as (select '&input_string' as txt from dual)
5 select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
6 from t
7 connect by level <= length(regexp_replace(txt,'[^,]*'))+1
8* )
SQL> /
Enter value for input_string: SCOTT,JAMES
old 4: with t as (select '&input_string' as txt from dual)
new 4: with t as (select 'SCOTT,JAMES' as txt from dual)
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7788 SCOTT ANALYST 7566 19-04-1987 00:00:00 3000 20
7900 JAMES CLERK 7698 03-12-1981 00:00:00 950 30
SQL>3. Split 10g onwards using XMLTABLE...
======================================
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'This is some sample text that needs splitting into words' as txt from dual)
2 select x.*
3 from t
4 ,xmltable('x/y'
5 passing xmltype('<x><y>'||replace(t.txt,' ','</y><y>')||'</y></x>')
6 columns word varchar2(20) path '.'
7* ) x
SQL> /
WORD
This
is
some
sample
text
that
needs
splitting
into
words
10 rows selected. -
How to find out the status of a file in java
Hi
I have an application that writes xml files anytime it is invoked. I am writing all unique files to a windows directory.
i also have an ftp client working on that directory that scans all the files and sends them to the server every few minutes.
I want to find a way using which all the files except the one that is being currently written by the application are transferred.
Is there a way to find out in java as to what file is being written to by the operating system at that point of time ? I have looked around for quite a long time and have not been able to find a solution to this problem.
Any help will be deeply appreciated.out = new FileOutputStream(matcher.group(1)+".open" , true);
FileChannel ch = out.getChannel();
FileLock lock = ch.lock(0L, Long.MAX_VALUE, false);
// Connect print stream to the output stream
p = new PrintStream( out );
p.println ("\n" + parms.getProperty( value ) + "\n");
p.flush();
p.close();
lock.release();Ok, I tried implementing locks but I dont know why it is not working...An exception is thrown and nothing is wriiten to the file. I have employed a complete lock on the file so that no other JVM application can use it.
Actually this is a server that grabs data sent from an Iframe and writes it down to a temp file. I open a file input stream, lock it and then use a printwriter strream to write the realyed data to the file. Any inputs as to what is wrong with the code snippet above????? -
How to find out the cause of "Cannot create JDBC driver"?
A small Java web application constantly runs into a problem of "Cannot of create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresl://localhost:5432/myapp'". The problem still exists after upgrading the driver. After recycling the server, this problem will be resolved. It, however, will come back after a while.
Any suggestions to solve this problem?
Thanks a lot.jschell wrote:
vwuvancouver wrote:
Any suggestions to solve this problem?To start with get the full and complete stack trace.
However since it is an intermittent problem there are only two possibilities
1. You have some code that is written correctly and some that is not.
2. It is a resource not code usage problem. Such as that you are not closing all result sets, statements and connections.Here is related log messages:
2009-04-30 09:29:21,386 INFO XmlWebApplicationContext:601: - Closing application context [WebApplicationContext for namespace 'mybookmarks-servlet']
2009-04-30 09:29:21,387 INFO DefaultListableBeanFactory:273: - Destroying singletons in {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,viewResolver,localeResolver,untapedUrlMapping,urlMapping,localeChangeInterceptor,errorsController,myBookmarksController,bookmarkController,reminderController,accountController,userControllerMethodResolver,userFormController,searchFormController,directoryController,directoryControllerMethodResolver,secureHandlerMapping,signonInterceptor,addBookmarkFromListFormController,addBookmarkFormController,bookmarkValidator,editWebSiteEntryFormController,addCommentFormController,reminderFormController,genericReminderFormController,alterReminderDateFormController,contactFormController,invitationFormController,propertyConfigurer,mailSender]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,mailSender,userValidator,bookmarkService,dataSource,sessionFactory,transactionManager,accountDao,categoryDao,webSiteDao,siteVisitDao,reminderDao,commentDao,bookmarkDao]; root of BeanFactory hierarchy}
2009-04-30 09:29:21,388 INFO GenericWebApplicationContext:601: - Closing application context [org.springframework.web.context.support.GenericWebApplicationContext;hashCode=15954072]
2009-04-30 09:29:21,389 INFO DefaultListableBeanFactory:273: - Destroying singletons in {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [modelView,addCommentFormView,discoveryFormView,mostVisitedView,bookmarkListView,contactFormView,actionResultView,accountView,reminderFormView,reminderDateFormView,searchList2View,helpView,homeView,taggedListView,searchFormView,reminderListView,webSiteEntryFormView,reminderForm2View,categorizedList2View,invitationFormView,myHomeView,taggedList2View,contactListView,aboutView,bookmarkFormView,bookmarkForm2View,newEntries2View,categorizedListView,signinFormView,accountActionResultView,userFormView,siteActionResultView,searchListView,mostVisited2View,newEntriesView,errorHttp404View]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,viewResolver,localeResolver,untapedUrlMapping,urlMapping,localeChangeInterceptor,errorsController,myBookmarksController,bookmarkController,reminderController,accountController,userControllerMethodResolver,userFormController,searchFormController,directoryController,directoryControllerMethodResolver,secureHandlerMapping,signonInterceptor,addBookmarkFromListFormController,addBookmarkFormController,bookmarkValidator,editWebSiteEntryFormController,addCommentFormController,reminderFormController,genericReminderFormController,alterReminderDateFormController,contactFormController,invitationFormController,propertyConfigurer,mailSender]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,mailSender,userValidator,bookmarkService,dataSource,sessionFactory,transactionManager,accountDao,categoryDao,webSiteDao,siteVisitDao,reminderDao,commentDao,bookmarkDao]; root of BeanFactory hierarchy}
2009-04-30 09:29:21,391 INFO GenericWebApplicationContext:601: - Closing application context [org.springframework.web.context.support.GenericWebApplicationContext;hashCode=29369879]
2009-04-30 09:29:21,392 INFO DefaultListableBeanFactory:273: - Destroying singletons in {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [modelView,addCommentFormView,discoveryFormView,mostVisitedView,bookmarkListView,contactFormView,accountView,actionResultView,reminderFormView,reminderDateFormView,searchList2View,helpView,homeView,configView,taggedListView,searchFormView,reminderListView,webSiteEntryFormView,reminderForm2View,categorizedList2View,invitationFormView,taggedList2View,myHomeView,contactListView,aboutView,bookmarkFormView,bookmarkForm2View,newEntries2View,categorizedListView,signinFormView,accountActionResultView,userFormView,siteActionResultView,searchListView,mostVisited2View,newEntriesView,errorHttp404View]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,viewResolver,localeResolver,untapedUrlMapping,urlMapping,localeChangeInterceptor,errorsController,myBookmarksController,bookmarkController,reminderController,accountController,userControllerMethodResolver,userFormController,searchFormController,directoryController,directoryControllerMethodResolver,secureHandlerMapping,signonInterceptor,addBookmarkFromListFormController,addBookmarkFormController,bookmarkValidator,editWebSiteEntryFormController,addCommentFormController,reminderFormController,genericReminderFormController,alterReminderDateFormController,contactFormController,invitationFormController,propertyConfigurer,mailSender]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,mailSender,userValidator,bookmarkService,dataSource,sessionFactory,transactionManager,accountDao,categoryDao,webSiteDao,siteVisitDao,reminderDao,commentDao,bookmarkDao]; root of BeanFactory hierarchy}
2009-04-30 09:29:21,394 INFO XmlWebApplicationContext:601: - Closing application context [Root WebApplicationContext]
2009-04-30 09:29:21,395 INFO DefaultListableBeanFactory:273: - Destroying singletons in {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,mailSender,userValidator,bookmarkService,dataSource,sessionFactory,transactionManager,accountDao,categoryDao,webSiteDao,siteVisitDao,reminderDao,commentDao,bookmarkDao]; root of BeanFactory hierarchy}
2009-04-30 09:29:21,396 INFO LocalSessionFactoryBean:184: - Closing Hibernate SessionFactory
2009-04-30 09:29:21,397 INFO SessionFactoryImpl:767: - closing
2009-04-30 09:29:21,408 WARN JDBCExceptionReporter:71: - SQL Error: 0, SQLState: null
2009-04-30 09:29:21,410 ERROR JDBCExceptionReporter:72: - Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql://localhost:5432/homepage'
2009-04-30 09:29:21,411 WARN JDBCExceptionReporter:71: - SQL Error: 0, SQLState: null
2009-04-30 09:29:21,414 ERROR JDBCExceptionReporter:72: - Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:postgresql://localhost:5432/homepage'
...Your analysis seems very reasonable. As the above log messages, this application is built on Hibernate and Spring. All back end is taken care by Hibernate. I don't have a direct control on it. I should ask the Hibernate crowd about this issue. The Hibernate forum is still down at this moment.
Edited by: vwuvancouver on Apr 30, 2009 1:12 PM -
How can I find out the number of lines in a text file?
How can I find out the number of lines in a text file?
java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
int lineCount = 0;
while( in.readLine() != null )
lineCount ++;
System.out.println( "Line Count = " + lineCount ); -
How to find out the JVM thread that is consuming high CPU
I am using WL 10.3, JRockit JVM on Linux. I have taken thread dumps. How to find out the JVM thread that is consuming high CPU?
I know how to map it Sun JVM on Solaris. I haven't done in on JRockit so far. Please advise.Check out some of Marcus Hirt's blog entries for details about how to use JRockit Mission Control. It's a very nice tool that should provide a lot of insight:
http://blogs.oracle.com/hirt/ -
How can I find out the number of pixels a photo has in i photo.
How can I find out the number of pixels a photo has in iphoto.
Do you mean in iPhoto on the MacBook Pro?
The dimensions (width and height iin pixels)are shown in the "Info" panel - multiply the two numbers:
Regards
Léonie
P.S: on an IOS device you see the same information in iPhoto, when you select the photo in an album and click th Info button ( i ).
Maybe you are looking for
-
Does the new Ipod Nano work with AUDI Music Interface
Getting a new Audi A4 with music interface and wanted to know if this will work with Ipod Nano or do I need Ipod Classic or Touch?
-
Search result in CRM_KW
Hi, we save documents on the content server from the document tab on BP. In transaction CRM_KW the documents can be search for by using attributes like keywords. The problem is that the search result in CRM_KW only presents 100 hits. Does anyone know
-
New hard drive-Time machine trouble
I exchanged my hard drive from a 160GB to a 500GB recently. All went well with the installation of the old programs and transferring all my old files back from my time machine. Now a week has gone by and I want to back up my computer to the time mach
-
Exception occuring while i'm trying to convert decimal to Hex
Hello all you genius people, please help me out. I'm using this simple code(given below) to read String from a file then convert it to Hex and write in anoher file. But i'm getting this exception that, after reading few lines it gives such exception:
-
Directing workflow transition based on form element value
Question 1 ======= How can workflow change values in a form element? Example: We have an expense aproval form. If the form transits from state ManagerA to state Reject, I want the form element Rejected by: to be automaticaly set to value ManageA. How