De-allocate memory after execution of main application
Hi All,
My application (Exe) takes 5MB on system RAM when it is just launched (will be in idle loop). It executes test cases that are available in an Excel file, upon a button press, and goes into idle after completing the execution. During test execution it collects lot of data from instruments and processes it. Everything looks fine till now.
The problem is, after the execution it holds around 250 MB of RAM because of the data handled during the test. So I am trying to figureout a way to deallocate all unused memory related to the application.
Note: I know about "Request Deallocation" LabVIEW primitive. To make use of it I have to place it on all subVIs to deallocate memory at the end of execution. Even then memory allocated in my main statemachine will remain allocated.
I need to deallocate those memory and bring it to the state of '5MB initial condition' as mentioned above.
Please share your ideas.
Anandelamaran Duraisamy,
Senior Project Engineer,
Soliton Technologies (P) Ltd,
www.solitontech.com
LV attempts to help out by managing your memory in your behalf. As already noted above, allocating is something that should be avoided so LV will allocate and keep memory. It will not give it up until all chances of reusing that memory are gone i.e. when the app exits.
You could implement you "test" as a VI that is dynamically called executed and then closed. When the dynamic VI is clsoed its resources will be released and the memory freed up.
But that is a last ditch approach that I call on only when I can't "do it right". By doing it "right" I am refering to constructing your code such that it re-uses memory buffers by working in-place with all large data strucutres. DVR's can help you "work inplace" as well as Action Engines.
If you are intersted in reading more about performance issue in LV I suggest you look over the threads linked in this Tag Cloud where I have collected links for a lot of very good threads discussing performance. If you give those thread a good study and take the time to understand the issues you will be well on your way to becoming a LV Performance master.
Have fun!
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Similar Messages
-
How to populate the field after execution of the application
Hello gurus,
I am creating one application and need your help. on my webdynpro screen I have few fields, out of these user will enter some and one field I want to populate when user hit enters. My application is to create a sales order, user will enter the details and hit create button that will create the sales order. Now what I want is when the sales order is created on the same screen the sales order number should also be displayed in the field : VBELN. Can you please tell me how can I get this.
Thank
RajeevHi Rajeev, if I understand you want show in a field that was created the VBELN after execute BAPI, well I assume that this field is binding with context document->Att_VBELN. You can use the code below.
DATA lo_nd_document TYPE REF TO if_wd_context_node.
DATA lo_el_document TYPE REF TO if_wd_context_element.
DATA ls_document TYPE wd_this->element_document.
DATA lv_att_vbeln TYPE wd_this->element_document-att_vbeln.
lo_nd_document = wd_context->get_child_node( name = wd_this->wdctx_document ).
lo_el_document = lo_nd_document->get_element( ).
IF lo_el_document IS INITIAL.
ENDIF.
lv_att_vbeln = <<RETURNED VBELN FROM BAPI>>.
lo_el_document->set_attribute(
name = `ATT_VBELN`
value = lv_att_vbeln ).
Regards,
Edson Thomaz -
Allocate Memory in the application
Hello All,
Would some one please tell me how to allocation memory for application that need a lot of memory in Java? I remember you can write system.allocateMem()
in your application.
Thankshi
ur question is very good ,we can allocate memory explicitly but it's better to use the gc() method in our application.
when u r creatiing a huge application that time when u feel that or the JVM will give the error that the " Less Memorry" that time u can use the gc() method for those object that r no longer to be refered this is the way u can increse your memory. -
JVM reserves additional memory after object creation
Hi everybody,
i have a problem with starting the JVM from inside a C++application. Starting the VM with JNI_CreateJavaVM works as aspected. When creating the first object it seems like the JVM reserves additional memory (outside the heap). Here is a little c++ test case:
/* Compile/Link: cl -MT -Zi -EHsc -I%JAVA_HOME%\include jvmtest0.cxx user32.lib %JAVA_HOME%\lib\jvm.lib */
#include "windows.h"
#include <string>
#include <jni.h>
int availMem () {
int i,j;
void* v[2048];
for (i=0;i<2048;i++) {
if ((v=malloc(1024*1024))==0) break;
for (j=0;j<i;j++) free(v[j]);
return i;
int WINAPI WinMain(HINSTANCE hinst,HINSTANCE hprev,LPSTR cmd,int show)
int i1=availMem();
JavaVMInitArgs arg;
JavaVMOption opt[1];
arg.version=JNI_VERSION_1_2;
arg.ignoreUnrecognized=JNI_TRUE;
opt[0].optionString="-Xmx256m";
arg.nOptions=1;
arg.options=opt;
JavaVM* vm;
JNIEnv* en;
if (JNI_CreateJavaVM(&vm,(void**)&en,&arg)<0) {
MessageBox(NULL,"Error CreateJavaVM","jvm-Test",MB_OK);
return (1);
jclass clFrame=en->FindClass("Ljavax/swing/JFrame;");
if (clFrame==0) {
MessageBox(NULL,"Error FindClass","jvm-Test",MB_OK);
return (1);
jmethodID methodID=en->GetMethodID(clFrame,"<init>","(Ljava/lang/String;)V");
if (methodID==0) {
MessageBox(NULL,"Error GetMethodID","jvm-Test",MB_OK);
return (1);
int i2=availMem();
jobject window=en->NewObject(clFrame,methodID,en->NewStringUTF("Test"));
if (window==0) {
MessageBox(NULL,"Error NewObject","jvm-Test",MB_OK);
return (1);
int i3=availMem();
char o[256];
sprintf_s(o,"Available memory:\nStart: %d MB\nAfter CreateJavaVM: %d MB\nAfter JFrame: %d MB",i1,i2,i3);
MessageBox(NULL,o,"jvm-Test",MB_OK);
return (0);
I'am running on Windows XP with JDK 1.5.0_02 and get the following result:
Start: 1906 MB
After CreateJavaVM: 1558 MB
After JFrame: 1312 MB
I would expect that the available memory after constructing the Java object is similar to the available memory after creating the JVM. On Linux it is.
Thanksa=null
MyClass a = new MyClass();
is the same as
MyClass a = new MyClass();
because after MyClass a = new MyClass(), doesn't point to a possible old instance but to a new instance of MyClass.
I guess, the problem is in some other data structure you build. perhaps the vector that contains lots of/big other objects? does any other class point to these objects too? remember: the garbage collector does clean up only unused memory, i.e. objects that are not referenced by any other objects that are valid (i.e. are referenced by the main thread or objects of the main thread). -
How to close sub-application without close main-application?
My main application has a menu which is used to open sub-application window. When I want to close the sub-application, I do not want to use System.exit(0), because it will close the main-application too.
And if I use setVisible(false), the sub-application remains in memory.
How can I close a sub-application clearly and keep the main-application open?Stephen:
Some other object may be holding reference to this object.
Here is how you debug such as problem.
1. Run your app in the IDE's debugger.
2. After you think all refs to the object should have gone away, pause the debug session.
3. Using the View/Debug Windows/Heap menu, bring up the heap window.
4. Right mouse click on the heap window. Enter the class name (package qualified) of the object which isn't being collected.
5. Then, find the object that instance. Select it.
6. Do right mouse click on that and select 'Show Reference Paths.'
It will show paths to this object. It will show you who's holding ref to this object, preventing it from being garbage collected.
Thanks.
Sung -
Selection Screen getting refreshed after execution..
Hello All,
I have a strange problem..
My selection-screen values are getting refreshed after execution and come back to selection screen. I am using normal ALV Fm to display the values. Can some suggest a possible reason?
Many thanks,
V NairNo .. I have checked it..Selection variables are not getting refreshed.
My Code Below
REPORT yhr_icm_exception_report.
Type Pool declarations
TYPE-POOLS: slis, "For AlV
sdydo, "Dynamic Documents
icon. "For ICON
Table declarations
TABLES : yhr_icm_exp_log, "ICM Exceptions Log
yhr_icm_exp_hist. "ICM Exception History
Include Constants
INCLUDE yhr_icm_constants . "Program to hold constants
Types declarations
*-To hold return field
TYPES: BEGIN OF ty_returntab.
INCLUDE STRUCTURE ddshretval. "Interface Structure
TYPES: END OF ty_returntab.
*-To hold deletion records
TYPES : BEGIN OF ty_icm_del,
tab_name TYPE yhr_tabname, "Internal table name
objid TYPE hrobjid, "Object ID
begda TYPE begda, "Begin Date
otype TYPE otype, "Object Type
END OF ty_icm_del.
*-Message details to be displayed
TYPES : BEGIN OF ty_message,
msgnr TYPE msgno, "System message number
text TYPE yhr_icm_exp_log-msgxx, "Message Text
END OF ty_message.
*-To hold exception log
TYPES : BEGIN OF ty_icm_exp_log,
msgno TYPE msgnr, "Message number
run_id TYPE yhr_icm_erun_id, "Exception Run ID
delta_id TYPE yhr_icm_run_id, "Run ID
record_type TYPE yhr_icm_exp_type, "Record Type
otype TYPE yhr_otype, "Object Type
objid TYPE hrobjid, "Object ID
begda TYPE begda, "Begin Date
msgxx TYPE msgxx, "Message
status TYPE yhr_icm_icon, "Status
delta_relevance TYPE yhr_delta_rel, "Delta Relevance
END OF ty_icm_exp_log.
*-To hold email attachment
TYPES: BEGIN OF ty_attach,
text(500) TYPE c, "Text
END OF ty_attach.
*To hold object type & text
TYPES :BEGIN OF ty_objid_text,
objid TYPE objid, "Object ID
text TYPE emnam, "Object Text
END OF ty_objid_text.
*-To hold counter values - Exp , Del & historical
TYPES :BEGIN OF ty_count,
exp(10) TYPE c, "Exceptions
del(10) TYPE c, "Deletions
hist(10) TYPE c, "Historical Deletions
END OF ty_count.
*- To hold lock details
TYPES : BEGIN OF ty_lock,
live TYPE c, "Live Callidus Program
genr TYPE c, "Generation Program
exp TYPE c, "Exception Program
END OF ty_lock.
Range Declarations
RANGES :
gr_objid FOR hrp1001-objid, "Range for Object ID
gr_pernr FOR pa0000-pernr. "Range for Employee number
Internal Table Declarations
DATA : gt_records TYPE STANDARD TABLE OF yhr_icm_exp_report,
gt_objid_text TYPE STANDARD TABLE OF ty_objid_text,
gt_icm_exp_log TYPE STANDARD TABLE OF ty_icm_exp_log,
gt_returntab TYPE STANDARD TABLE OF ty_returntab,
gt_t777o TYPE STANDARD TABLE OF t777o,
gt_diff_tab TYPE STANDARD TABLE OF yhr_icm_diff,
gt_del_tab TYPE STANDARD TABLE OF ty_icm_del, "#EC *
gt_iattach TYPE STANDARD TABLE OF ty_attach,
gt_message TYPE STANDARD TABLE OF ty_message,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_heading TYPE slis_t_listheader,
gt_exceptions TYPE yhr_icm_exp_list_t,
gt_events TYPE slis_t_event.
Structure Declarations
DATA : gs_objid_text TYPE ty_objid_text,
gs_icm_exp_log TYPE ty_icm_exp_log,
gs_records TYPE yhr_icm_exp_report,
gs_exceptions TYPE yhr_icm_exp_list,
gs_count TYPE ty_count,
gs_fieldcat TYPE slis_fieldcat_alv, "#EC *
gs_returntab TYPE ty_returntab,
gs_icm_exp_hist TYPE yhr_icm_exp_hist,
gs_iattach TYPE ty_attach,
gs_message TYPE ty_message, "#EC *
gs_layout TYPE slis_layout_alv,
gs_t777o TYPE t777o,
gs_lock TYPE ty_lock.
Constant declarations
CONSTANTS:
c_yes TYPE string VALUE 'YES',
c_no TYPE string VALUE 'NO',
c_true TYPE c VALUE 'X',
c_deletions TYPE c VALUE 'D',
c_delta_no TYPE c VALUE 'N',
c_delta_yes TYPE c VALUE 'Y',
c_historical TYPE c VALUE 'H',
c_a TYPE c VALUE 'A',
c_error TYPE c VALUE 'E',
c_equal(2) TYPE c VALUE 'EQ',
c_participants TYPE c VALUE 'P',
c_include TYPE c VALUE 'I',
c_position TYPE c VALUE 'S',
c_organization TYPE c VALUE 'O',
c_runlock TYPE string VALUE 'RUN_LOCK',
c_parameter TYPE string VALUE 'P',
c_selfield TYPE string VALUE 'SEL_FIELD' ,
c_type TYPE string VALUE 'TYPE',
c_topofpage TYPE string VALUE 'TOP_OF_PAGE',
c_rectype TYPE string VALUE ' S_RECTYPE',
c_objectkey TYPE string VALUE 'OBJECTKEY1',
c_icon_green TYPE string VALUE '@08@',
c_icon_red TYPE string VALUE '@0A@',
c_icon_amber TYPE string VALUE '@09@',
c_green TYPE string VALUE 'GREEN',
c_amber TYPE string VALUE 'AMBER',
c_red TYPE string VALUE 'RED',
c_tabname TYPE slis_tabname VALUE 'GT_RECORDS',
c_structname TYPE dd02l-tabname VALUE 'YHR_ICM_EXP_REPORT' ,
c_siwb_wallpaper TYPE sdydo_key VALUE 'SIWB_WALLPAPER',
c_user_command TYPE slis_formname VALUE 'F01_ALV_EVENT_USER_COMMAND',
c_genname TYPE trdir-name VALUE 'YHR_ICM_GENERATE_EXCEPTIONS',
c_expname TYPE trdir-name VALUE 'YHR_ICM_EXCEPTION_REPORT',
c_pf_status TYPE slis_formname VALUE 'SET_PF_STATUS',
c_msg_class TYPE string VALUE 'YHR_ICM'.
Global Variable Declarations
DATA: gv_email_error TYPE c,
gv_email_sent TYPE c,
gv_exit TYPE c.
Selection Screen - Block I
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-s07.
SELECT-OPTIONS:
*- Run ID
s_run_id FOR yhr_icm_exp_hist-run_id,
*- Exception Type
s_rectyp FOR yhr_icm_exp_log-record_type NO INTERVALS,
*- Object Type
s_otype FOR yhr_icm_exp_log-otype NO INTERVALS,
*- Object ID
s_objid FOR yhr_icm_exp_log-objid NO INTERVALS,
*- Start Date
s_begda FOR yhr_icm_exp_log-begda,
*- Message number
s_msgno FOR yhr_icm_exp_log-msgno,
*- Message Text
s_msgxx FOR yhr_icm_exp_log-msgxx.
SELECT-OPTIONS:
*- Delta Relevance
s_relv FOR yhr_icm_exp_log-delta_relevance NO INTERVALS.
PARAMETERS:
*- Long Text
p_ltext AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN: END OF BLOCK b3.
Selection Screen - Block II
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-s08.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(14) text-033.
*-Sucess
PARAMETERS:
p_stat_s AS CHECKBOX. "D11K917251
SELECTION-SCREEN COMMENT 24(14) text-034.
*-Warning
PARAMETERS:
p_stat_w AS CHECKBOX. "D11K917251
SELECTION-SCREEN COMMENT 48(15) text-035.
PARAMETERS:
*-Error
p_stat_e AS CHECKBOX . "D11K917251
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK b2.
Selection Screen - Block III
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-s09.
*-Email Details
PARAMETERS:
p_email(128) TYPE c.
SELECTION-SCREEN: END OF BLOCK b4.
Selection Screen on value request.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_msgno-low.
PERFORM f4_message.
Selection Screen Output.
AT SELECTION-SCREEN OUTPUT.
CHECK gt_returntab[] IS NOT INITIAL.
REFRESH s_msgno.
s_msgno-option = c_equal.
s_msgno-sign = c_include.
LOOP AT gt_returntab INTO gs_returntab.
s_msgno-low = gs_returntab-fieldval.
s_msgno-high = space.
APPEND s_msgno.
ENDLOOP.
At Selection Screen for Validation
AT SELECTION-SCREEN.
CLEAR gv_email_error.
*-Validate Object Type
PERFORM validate_objecttype.
*-Validate Exception ID
PERFORM fetch_exp_header.
*-Validate Exception Type
PERFORM validate_exptype.
*-Validate Message Number
PERFORM validate_msgno.
*-Validate Message Type
PERFORM validate_msgtype.
*-Validate Delta
PERFORM validate_delta.
*-Validate Email ID
PERFORM validate_email USING p_email
CHANGING gv_email_error.
IF gv_email_error IS NOT INITIAL.
MESSAGE e000(yhr_icm) WITH text-027.
ENDIF.
Initialization
INITIALIZATION.
Initialization
PERFORM initialization.
Start Of Selection
START-OF-SELECTION.
CLEAR : gv_email_error,
gv_email_sent,
gv_exit,
gs_lock.
Try locking the main program
PERFORM lock_generation_program.
CHECK gs_lock IS INITIAL.
*-Fetch the messages stored in table
PERFORM fetch_item_records.
Read object type text.
PERFORM read_text.
Get Object Text
PERFORM get_object_text.
*-Fetch the current SAP messages
PERFORM fetch_records.
*-Update Delta Flag
PERFORM update_delta_flag.
*-Compare messages in table & in SAP
PERFORM compare_message.
If receiver is not blank, try sending out mail
PERFORM send_mail USING p_email.
End Of Selection
END-OF-SELECTION.
IF gv_exit IS NOT INITIAL.
EXIT.
ENDIF.
*-Display ALV
PERFORM display_alv.
*-Build the event table for ALV display
PERFORM build_eventtab CHANGING gt_events[].
*-Fill the layout details
PERFORM layout_build .
Release all locks
PERFORM release_locks.
*-Finally call the grid display
PERFORM display_data.
*& Form set_pf_status
text
-->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab. "#EC *
Set PF Status
SET PF-STATUS 'STANDARD'.
ENDFORM. "Set_pf_status
*& Form DISPLAY_ALV
text
--> p1 text
<-- p2 text
FORM display_alv .
*- Use FM to create field catalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = c_tabname
i_structure_name = c_structname
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-001.
EXIT.
ENDIF.
*- Remove SEL Field Column as it is not required
DELETE gt_fieldcat WHERE fieldname = c_selfield.
*-If user chooses long text, activate icon
IF p_ltext IS INITIAL.
LOOP AT gt_fieldcat INTO gs_fieldcat WHERE fieldname = c_type.
gs_fieldcat-icon = c_true.
ENDLOOP.
ENDIF.
ENDFORM. " DISPLAY_ALV
*& Form BUILD_EVENTTAB
text
<--P_GT_EVENTS[] text
FORM build_eventtab CHANGING p_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
*-Get the list of event for alv
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_events.
*-Add top of page event to event list
READ TABLE p_events
WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE c_topofpage TO ls_event-form.
APPEND ls_event TO p_events.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*& Form LAYOUT_BUILD
text
--> p1 text
<-- p2 text
FORM layout_build .
gs_layout-zebra = c_true.
gs_layout-colwidth_optimize = c_true.
gs_layout-detail_popup = c_true.
gs_layout-detail_initial_lines = c_true.
gs_layout-detail_titlebar = text-044.
gs_layout-box_fieldname = c_selfield.
ENDFORM. " LAYOUT_BUILD
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
*-Display ALV display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_user_command = c_user_command
i_background_id = c_siwb_wallpaper
i_callback_program = sy-repid
i_callback_pf_status_set = c_pf_status
i_default = c_true
i_save = c_a
is_layout = gs_layout
it_fieldcat = gt_fieldcat
it_events = gt_events
TABLES
t_outtab = gt_records.
ENDFORM. " DISPLAY_DATA
*& Form FETCH_RECORDS
text
--> p1 text
<-- p2 text
FORM fetch_records .
REFRESH : gt_diff_tab,
gt_del_tab,
gr_pernr,
gt_exceptions.
CLEAR: gs_icm_exp_log.
*-Get Employee details
PERFORM get_person_data.
*-Get Position Details
PERFORM get_position_data.
*-Get Organization Details
PERFORM get_org_data.
*-Get Exception current SAP exception list.
PERFORM get_exception_list.
*-Add deletion records
PERFORM filter_deletions.
ENDFORM. " FETCH_RECORDS
*& Form top_of_page
text
FORM top_of_page. "#EC *
PERFORM build_comment USING gt_heading.
*-Display Use FM to display Top Of Page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_heading[].
CLEAR gt_heading.
ENDFORM. "TOP_OF_PAGE
*& Form build_comment
text
-->P_HEADING text
FORM build_comment USING p_heading TYPE slis_t_listheader.
DATA: ls_hline TYPE slis_listheader,
lv_text(120) TYPE c.
*-Display report title
ls_hline-typ = c_historical.
WRITE text-006 TO lv_text.
ls_hline-info = lv_text.
APPEND ls_hline TO p_heading.
CLEAR ls_hline.
ls_hline-typ = c_s.
*-Remove leading & trailing spaces
CONDENSE : gs_count-del, gs_count-exp, gs_count-hist.
*-If the count is space then pass 0
IF gs_count-del = space.
gs_count-del = 0.
ENDIF.
IF gs_count-exp = space.
gs_count-exp = 0.
ENDIF.
IF gs_count-hist = space.
gs_count-hist = 0.
ENDIF.
IF gs_lock IS INITIAL.
*-Display Deletion, Exception, Historical Count
CONCATENATE text-037 gs_count-del
text-032 gs_count-exp
text-039 gs_count-hist
INTO ls_hline-info SEPARATED BY space.
ELSEIF gs_lock-live IS NOT INITIAL.
ls_hline-info = text-007.
ELSEIF gs_lock-genr IS NOT INITIAL.
ls_hline-info = text-008.
ELSEIF gs_lock-exp IS NOT INITIAL.
ls_hline-info = text-009.
ENDIF.
APPEND ls_hline TO p_heading.
CLEAR ls_hline.
ENDFORM. "BUILD_COMMENT
*& Form INITIALIZATION
text
--> p1 text
<-- p2 text
FORM initialization .
Read Previous run
SELECT MAX( run_id )
INTO s_run_id-low
FROM yhr_icm_exp_hist. "#EC *
s_run_id-option = c_equal.
s_run_id-sign = c_include.
APPEND s_run_id.
s_rectyp-option = c_equal.
s_rectyp-sign = c_include.
s_rectyp-low = c_error.
APPEND s_rectyp.
s_rectyp-low = c_deletions.
APPEND s_rectyp.
PERFORM restrict_selections.
*Get the message from Message Class YHR_ICM
SELECT msgnr
text
FROM t100
INTO TABLE gt_message
WHERE arbgb = c_msg_class AND
msgnr GT '000'. "#EC *
ENDFORM. " INITIALIZATION
*& Form F4_MESSAGE
text
<--P_P_MSGNO text
FORM f4_message.
F4 Help - Display all messages
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MSGNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'S_MSGNR'
window_title = text-045
value_org = c_s
multiple_choice = c_true
TABLES
value_tab = gt_message
return_tab = gt_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-002.
EXIT.
ELSEIF sy-subrc = 2.
MESSAGE i000(yhr_icm) WITH text-003.
EXIT.
ENDIF.
ENDFORM. " F4_MESSAGE
*& Form VALIDATE_OBJECTTYPE
text
--> p1 text
<-- p2 text
FORM validate_objecttype .
CHECK s_otype-low IS NOT INITIAL.
CONDENSE s_otype-low.
Validate object type to check whether user has entered only S, P or O
IF s_otype-low NE c_organization AND
s_otype-low NE c_position AND
s_otype-low NE c_participants .
MESSAGE e000(yhr_icm) WITH 'Enter either S(Position), P(Person) or O(Org Unit)'(021).
ENDIF.
ENDFORM. " VALIDATE_OBJECTTYPE
*& Form VALIDATE_OBJECTTYPE
FORM f01_alv_event_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield."#EC *
DATA : lv_answer TYPE c,
lt_fields TYPE STANDARD TABLE OF sval,
ls_fields TYPE sval.
*-Get the row user has selected in ALV list
READ TABLE gt_records INTO gs_records INDEX rs_selfield-tabindex.
CASE r_ucomm.
WHEN 'DISP'.
CASE gs_records-otype.
WHEN 'S'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
WHEN 'P'.
SET PARAMETER ID 'PER' FIELD gs_records-objid.
CALL TRANSACTION 'PA20' AND SKIP FIRST SCREEN.
WHEN 'O'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
ENDCASE.
WHEN 'CHNG'.
CASE gs_records-otype.
WHEN 'S'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
WHEN 'P'.
SET PARAMETER ID 'PER' FIELD gs_records-objid.
CALL TRANSACTION 'PA30' AND SKIP FIRST SCREEN.
WHEN 'O'.
SET PARAMETER ID 'POT' FIELD gs_records-otype.
SET PARAMETER ID 'PON' FIELD gs_records-objid.
CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
ENDCASE.
WHEN 'EMAIL'.
*- Check whether email has already been sent
IF gv_email_sent = c_true.
*- If yes, then display pop up to confirm for mailing again
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = text-041
text_button_1 = text-042
text_button_2 = text-043
IMPORTING
answer = lv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-004.
EXIT.
ENDIF.
*- Continue only if user has selected Yes
CHECK lv_answer = '1'.
ENDIF.
*- Add Email Field & Table
ls_fields-tabname = 'SZA5_D0700'.
ls_fields-fieldname = 'SMTP_ADDR'.
APPEND ls_fields TO lt_fields.
*- Use FM to get new Email ID
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
popup_title = text-s09
start_column = '5'
start_row = '5'
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 1.
IF sy-subrc = 1.
MESSAGE i000(yhr_icm) WITH text-004.
EXIT.
ENDIF.
*- Get the Email user has entered
READ TABLE lt_fields INTO ls_fields INDEX 1.
*- Validate Email ID
PERFORM validate_email USING ls_fields-value
CHANGING gv_email_error.
*- If the flag is not initial, indicates possible error
IF gv_email_error IS NOT INITIAL.
MESSAGE i000(yhr_icm) WITH text-027.
EXIT.
ELSE.
If no error, then try ending email
PERFORM send_mail USING ls_fields-value.
ENDIF.
WHEN 'REFRESH'.
*- Fetch the current SAP messages
PERFORM fetch_records.
*- Update Delta Flag
PERFORM update_delta_flag.
*- Compare messages in table & in SAP
PERFORM compare_message.
*- Refresh alv which is already displayed
rs_selfield-refresh = c_true.
ENDCASE.
ENDFORM. "F01_ALV_EVENT_USER_COMMAND
*& Form RESTRICT_SELECTIONS
text
--> p1 text
<-- p2 text
FORM restrict_selections .
TYPE-POOLS sscr.
STATICS: lt_restrict TYPE sscr_restrict,
lt_opt_list TYPE sscr_opt_list,
ls_*** TYPE sscr_***.
Restrict the wage type selection so the user can only enter
values with the 'EQ' clause.
CLEAR lt_opt_list.
MOVE c_objectkey TO lt_opt_list.
MOVE c_true TO: lt_opt_list-options-eq,
lt_opt_list-options-bt,
lt_opt_list-options-cp,
lt_opt_list-options-eq,
lt_opt_list-options-ge,
lt_opt_list-options-gt,
lt_opt_list-options-le,
lt_opt_list-options-lt.
APPEND lt_opt_list TO lt_restrict-opt_list_tab.
MOVE: c_s TO ls_***-kind,
c_rectype TO ls_***-name,
c_include TO ls_***-sg_main,
space TO ls_***-sg_addy,
c_objectkey TO ls_***-op_main.
APPEND ls_*** TO lt_restrict-***_tab.
*-Restrict the values OTYPE
MOVE 'S_OTYPE' TO ls_***-name.
APPEND ls_*** TO lt_restrict-***_tab.
*-Restrict the values OBJID
MOVE 'S_OBJID' TO ls_***-name.
APPEND ls_*** TO lt_restrict-***_tab.
*-Use FM to restrict the values
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = lt_restrict.
ENDFORM. " RESTRICT_SELECTIONS
*& Form GET_PERSON_DATA
text
--> p1 text
<-- p2 text
FORM get_person_data .
DATA : lt_del_tab TYPE STANDARD TABLE OF yhr_icm_diff.
SORT gt_icm_exp_log BY msgno .
gr_pernr-sign = c_include.
gr_pernr-option = c_equal.
LOOP AT gt_icm_exp_log INTO gs_icm_exp_log WHERE otype = c_participants AND
record_type = c_error.
*- Sort the table based on msgno and collect pernr
gr_pernr-sign = c_include.
gr_pernr-option = c_equal.
gr_pernr-low = gs_icm_exp_log-objid.
APPEND gr_pernr.
CLEAR gr_pernr-low.
AT END OF msgno. "#EC *
*- For the list of Pernr having same PERNR get the current exp details
IF gs_icm_exp_log-msgno = c_msg_100.
*- Export the pernr list to memory id & import in the below FM
*- Selection of records should be based on values exported from here
EXPORT gr_pernr TO MEMORY ID 'PERNR_0001'.
Get Org Assignment 0001 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0001_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_101. "Y_HR_DIFF_PERNR_0001_ORG_DATA
ELSEIF gs_icm_exp_log-msgno = c_msg_102 .
EXPORT gr_pernr TO MEMORY ID 'PERNR_0000'.
Get Actions 0000 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0000_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_103.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0002'.
Get Personal Details 0002 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0002_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_104.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0004'.
Get Disability 0004 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0004_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_105.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0006'.
Get Addresses 0006 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0006_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_106.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0007'.
Get Planned Time 0007 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0007_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_107.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0016'.
Get Contract Element 0016 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0016_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_108.
EXPORT gr_pernr TO MEMORY ID 'PERNR_0077'.
Get Additional Personal 0077 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0077_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_109 .
EXPORT gr_pernr TO MEMORY ID 'PERNR_0105'.
Get Communications 0105 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_0105_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda
refresh = space
UPDATE = space
TABLES
diff_tab = gt_diff_tab
del_tab = lt_del_tab.
ELSEIF gs_icm_exp_log-msgno = c_msg_110.
EXPORT gr_pernr TO MEMORY ID 'PERNR_2001'.
Get Absences 2001 Data
CALL FUNCTION 'Y_HR_DIFF_PERNR_2001_DATA'
EXPORTING
period_begda = gs_icm_exp_hist-begda
period_endda = gs_icm_exp_hist-endda -
Run External application without Exiting main application
Hi,
I am trying to implement a function that executes the external program from within my java application. I am using windows xp. I had googled for this and found some code but so far I am able to run the application in a condition if my main application exits. Instead I want to run the application without exiting my main application. How can I do that:
Code I am using is:
========================
try{
Runtime.getRuntime().exec("external program");
System.exit(0);
catch (Exception err){
err.printStackTrace();
System.exit(-1);
=========================
my problem is I cannot run the external program without the line "System.exit(0)". If I remove that line, the external program only starts after I exit my main java application. Is there a way to run the external application without leaving the main application?
By the way I am using the latest version of JDK 6 update 2 and Netbeans 5.5.1
ThanksI tried and I tried and I couldn't make the same problem occur unless I specfically had a long task execute BEFORE calling the runtime command. See the code below:
I tried a bunch of things, including having a GUI run before the Runtime call, after the runtime call. Neither affected the movie from being played.
I tried with different versions of the runtime command, none of it made a problem.
I tried running the application with a long task that would keep the main thread busy for a while AFTER I launched mplayer - no problem.
The only thing that made the app work the way you describe was when I built the long task that keeps the main thread active for a while BEFORE I launched mplayer (which is the state of the code as I pasted it below).
So my guess is that you have a single threaded application and you add the call to mplayer at the very end of your program's execution - thus it doesn't get called until the last thing. My suggestions:
1) Move the call to the Start of your code, not the end
2) Move your other work to a new thread so that it can be kicked off without holding the main thread in check.
package movies;
import inheritance.BaseWindow;
import java.util.*;
import java.io.*;
class StreamGobbler extends Thread
InputStream is;
String type;
OutputStream os;
StreamGobbler(InputStream is, String type)
this(is, type, null);
StreamGobbler(InputStream is, String type, OutputStream redirect)
this.is = is;
this.type = type;
this.os = redirect;
public void run()
try
PrintWriter pw = null;
if (os != null)
pw = new PrintWriter(os);
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line=null;
while ( (line = br.readLine()) != null)
if (pw != null)
pw.println(line);
System.out.println(type + ">" + line);
if (pw != null)
pw.flush();
} catch (IOException ioe)
ioe.printStackTrace();
public class MyMainClass
public static void main(String args[]) throws InterruptedException
//This is just a GUI as a test
BaseWindow bw = new BaseWindow();
bw.show();
//Keep App Running for a while
int count = 0;
while (count < 200) {
Thread.sleep(20);
count++;
System.err.println(count);
if (args.length != 1)
System.out.println("USAGE java movies.MyMainClass \"<movie to play>\"");
System.exit(1);
try
Runtime rt = Runtime.getRuntime();
//String[] cmds = new String[] { "cmd", "/c", "C:\\Mplayer\\mplayer.exe", args[0]};
//String[] cmds = new String[] { "C:\\Mplayer\\mplayer.exe", args[0]};
//Process proc = rt.exec(cmds);
Process proc = rt.exec("C:\\Mplayer\\mplayer.exe "+args[0]);
// any error message?
StreamGobbler errorGobbler = new
StreamGobbler(proc.getErrorStream(), "ERROR");
// any output?
StreamGobbler outputGobbler = new
StreamGobbler(proc.getInputStream(), "OUTPUT");
// kick them off
errorGobbler.start();
outputGobbler.start();
//Keep App Running for a while
// int count = 0;
// while (count < 2000000) {
// Thread.sleep(200);
// count++;
// System.err.println(count);
// any error???
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
} catch (Throwable t)
t.printStackTrace();
}I will restate myself:
"I was not able to repeat the problem, except as described, as long as I took the hints mentioned in the article I posted into account and actually put them into action."
Of course, as soon as I ignored those hints, I was able to reproduce the error described above quite easily in all the different tests I made... But I guess the OP implemented those fixes, right? He did say he read the article...
Message was edited by:
stevejluke -
Returning to same tab after execution
I have a selection screen with 6 tabs. After execution, the screen always returns to the first tab. This is very annoying to my users and potentially can cause mistakes on re-running the application. Does anyone know of a way to go back to the same tab that was open when the program was executed?
Thanks.I answered this once on this forum...others have answered, also, so suggest you search. I don't recall the exact details, but I think I stored the ACTIVETAB value to memory, then recalled prior to returning to the selection screen.
Perhaps here:
[Return to TabStrip|Return to same tabstrip on selection screen; -
Java.lang.OutOfMemoryError: Cannot allocate memory in tsStartJavaThread
Running Java Application on Web logic managed server fails with following error:
java.lang.OutOfMemoryError: Cannot allocate memory in tsStartJavaThread (lifecycle.c:1096).
Java heap 1G reserved, 741076K committed
Paged memory=26548K/3145712K.
Your Java heap size might be set too high.
Try to reduce the Java heap size using -Xmx:<size> (e.g. "-Xmx128m").
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(ThreadPoolExecutor.java:703)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:652)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)
Memory doesn't seem to be an issue, because -Xmx = 1GB is specified in VM args.
This application needs only 200MB to run (Obtained by running the application in eclipse and
checking the heap memory usage).
Not sure whats causing this error? Application runs as single (main) thread
and towards the end of the program multiple threads(they do JDBC tasks) are
are spawned. In this particular case, 3 threads were about to be launched, when
this error occured. Please help in pointing out what the issue is and how this
can be resolved.
Here are further details on Jrockit version and VM arguments:
Following JRockit is used on the Weblogic machine.
$java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Oracle JRockit(R) (build R28.1.1-14-139783-1.6.0_22-20101206-0241-linux-ia32, compiled mode)
Following are the JVM arguments:
java -jrockit -Xms512m -Xmx1024m -Xss10240k
Thanks in advance.Noting that you are using a IBM vm and a rather old one at that...
Threads take java memory. Normally the solution is to increase the maximum java heap. Doing that depends on the memory that the system supports and the maximum that the VM allows and the default that it uses.
You might want to verify the command line options you are using. You might want to also find out what happens if you use a larger number or smaller one.
And if all else fails you can use a thread pool rather than trying to create seperate threads. -
GC stops freeing memory after a while
Hi,
We have four manged servers running on weblogic81 with hotspot; and are using the following GC setting for our application:
GC_PARAMS="-XX:ParallelGCThreads=4 -XX:+CMSParallelRemarkEnabled -XX:MaxTenuringThreshold=10 -XX:PermSize=128m "
JAVA_OPTIONS="-D${SERVER_NAME} -D${WL_DOMAIN_NAME} -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Ddefault.client.encoding=UTF-8 -Dweblogic.s
ecurity.SSL.ignoreHostnameVerify=false -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false"
MEM_ARGS="-Xms865m -Xmx865m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:PermSize=128m -XX:MaxPermSize=1
28m -XX:SurvivorRatio=3 -XX:MaxPermSize=128m -XX:SurvivorRatio=3 -Xloggc:${LOG_HOME}/${SERVER_NAME}/gc_pipe ${GC_PARAMS} "
JAVA_VM="-server"
The follwing is the output from the gc analyser perl script
Processing gc_pipe ...
Call rate = 55 cps ...
Active call-setup duration = 32000 ms
Number of CPUs = 1
DEBUG timestr: bt=60.884 et=7831.278 to=7770394
---- GC Analyzer Summary : gc_pipe ----
Application info:
Application run time = 7770394.00 ms
Heap space = 868 MB
Eden space = 130944 KB
Semispace = 64 KB
Tenured space = 757760 KB
Permanent space = 131072 KB
Young GC --------- (Copy GC + Promoted GC ) ---
Copy gc info:
Total # of copy gcs = 180
Avg. size copied = 4469555 bytes
Periodicity of copy gc = 43086.2519483333 ms
Copy time = 82 ms
Percent of pause vs run time = 0%
Promoted gc info:
Total number# of promoted GCs = 1365
Average size promoted = 2509130 bytes
Periodicity of promoted GC = 5637.85 ms
Promotion time = 54.74 ms
Percent of pause vs run time = 0.96 %
Young GC info:
Total number# of young GCs = 1545
Average GC pause = 57.99 ms
Copy/Promotion time = 57.99 ms
Overhead(suspend,restart threads) time = -10.68 ms
Periodicity of GCs = 4971.39 ms
Percent of pause vs run time = 1.15 %
Avg. size directly created old gen = 0.43 KB
Old concurrent GC info :
Heap size = 757760 KB
Avg. initial-mark threshold = 67.78 %
Avg. remark threshold = 0.00 %
Avg. Resize size = 0.00 KB
Total GC time (stop-the-world) = 133.22 ms
Concurrent processing time = 2338.00 ms
Total number# of GCs = 1
Average pause = 133.22 ms
Periodicity of GC = 7770260.78 ms
Percent of pause vs run time = 0.00 %
Percent of concurrent processing vs run time = 0.03 %
Permanent Generation GC info:
Total GC time = 0;
Total number# of GCs = 72;
Average pause = 0.00;
Periodicity = 107922.14;
Percent of pause vs run time = 0.00;
Total Old GC info (Concurrent + MS + Perm Gen):
Total GC time (stop-the-world) = 133.22 ms
Total Concurrent processing time = 2338.00 ms
Total number# of GCs = 1
Average pause = 133.22 ms
Periodicity of GC = 7770260.78 ms
Percent of stop-the-world pause vs run time = 0.00 %
Percent of concurrent processing vs run time = 0.03 %
Total (young and old) GC info:
Total count = 1546
Total GC time = 89725.68 ms
Average pause = 58.04 ms
Percent of pause vs run time = 1.15 %
Call control info:
Call-setups per second (CPS) = 55
Call rate, 1 call every = 18 ms
Number# call-setups / young GC = 273.426591796764
Total call throughput = 422444.08
Total size of short lived data / call-setup = 481217 bytes
Total size of long live data / call-setup = 9176 bytes
Average size of data / call = 490393
Total size of data created per young gen GC = 134086656 bytes
Execution efficiency of application:
GC Serial portion of application = 1.15%
Actual CPUs = 1
CPUs used for concurrent processing = 1.00
Application Speedup = 1.00
Application Execution efficiency = 1.00
Application CPU Utilization = 99.97 %
Concurrent GC CPU Utilization = 0.03 %
--- GC Analyzer End Summary ----------------
#--- Detailed and confusing calculations; dig into this if you need more info about what is happening above ----
---- GC Log stats ...
---- Young generation calcs ...
Average young gen dead objects size / GC = 131577525.92 bytes
Average young gen live objects size / GC cycle = 2509130.08 bytes
Ratio of short lived / long lived for young GC = 52.44
Average young gen size promoted = 0.00 bytes
Average number# of Objects promoted = 0
Total promoted times = 74723.82 ms
Average object promoted times = 0.00 ms
Total promoted GCs = 1365
Periodicity of promoted GCs = 5637.85 ms
Total copy times = 14868.65 ms
Total copy GCs = 180
Average copy GC time = 82.60 ms
Periodicity of copy GCs = 43086.25 ms
Total number# of young GCs = 1545
Total time of young GC = 89592.47 ms
Average young GC pause = 57.99 ms
Periodicity of young GCs = 4971.39 ms
--- Old generation concgc calcs ....
Total concurrent old gen times = 133.22 ms
Total number# of old gen GCs = 1
Average old gen pauses = 133.22 ms
Periodicity of old gen GC = 7770260.78 ms
--- Traditional MS calcs ...
Total number# mark sweep old GCs = 0
Total mark sweep old gen time = 0.00 ms
Average mark sweep pauses = 0.00 ms
Average free threshold = 0.00 %
Total mark sweep old gen application time = 0.00 ms
Average mark sweep apps time = 0.00 ms
--- Mark-Compact calcs ...
Total time taken by MC gc = 133.22 ms
Total number# of old gen GCs = 1
Total number# of old gen pauses with 0 ms = 133
Periodicity of MC gc = 0.00 ms
---- GC as a whole ...
Total GC time = 89725.68 ms
Average GC pause = 58.04 ms
Total # of gcs = 1546.00 ms
--- Heap calcs ...
Eden = 134086656 Bytes
Semispace = 65536 Bytes
Old gen heap = 775946240 Bytes
Perm gen heap = 134217728 Bytes
Total heap = 910098432.00 Bytes
## for concgc
Live objects per old GC = 0.00 KB
Dead objects per old GC = 0.00 KB
Ratio of (short/long) lived objects per old GC = 0.00
--- Memory leak verification ...
Total size of data promoted = 3344690.00 KB
Total size of data directly created in
old generation = 666.00 KB
Total size of data in old gen = 3345356.00 KB
Total size of data collected throughout app. run = 0.00 KB
--- Active duration calcs ...
Active duration of each call = 32000 ms
Number# number of calls in active duration = 1759
Number# of promotions in active duration = 5
Long lived objects(promoted objects) / active duration = 14241618.90 bytes
Short lived objects (tenured or not promoted) / active duration = 846941930.91 bytes
Total objects created / active duration = 861183549.81 bytes
Percent% long lived in active duration = 1.65 %
Percent% short lived in active duration = 98.35 %
Number# of active durations freed by old GC = 0.00
Ratio of live to freed data = 0.00
Average resized memory size = 0.00
Time when init GC might take place = 0.00 ms
Time when remark GC might take place = 0.00 ms
Periodicity of old GC = 7770260.78 ms
--- Application run times calcs ...
Total application run times during young GC = 5572109.73 ms
Total application run times during old GC = 0.00 ms
Total application run time = 5511433.32 ms
Calculated or specified app run time = 7770394.00 ms
Ratio of young (gc_time/gc_app_time) = 0.02
Ratio of young (gc_time/app_run_time) = 0.01
Ratio of (old gc_time/total gc_app_time) = 0.00
Ratio of (old gc_time/app_run_time) = 0.00
Ratio of total (gc_time/gc_app_time) = 0.02
Ratio of total (gc_time/app_run_time) = 0.01
weloadm@vwrpa41s:/var/applogs/weblogic/live/managed2/gc_128
What happens is after about 45 - 50 mins(sometimes 65-70 mins) on a load of 800 users, major gc is unable to free up any memory at all and the memory usage keeps on increasing. The above script is for the managed server that dies due to lack of memory.Hi,
We have four manged servers running on weblogic81 with hotspot; and are using the following GC setting for our application:
GC_PARAMS="-XX:ParallelGCThreads=4 -XX:+CMSParallelRemarkEnabled -XX:MaxTenuringThreshold=10 -XX:PermSize=128m "
JAVA_OPTIONS="-D${SERVER_NAME} -D${WL_DOMAIN_NAME} -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Ddefault.client.encoding=UTF-8 -Dweblogic.s
ecurity.SSL.ignoreHostnameVerify=false -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false"
MEM_ARGS="-Xms865m -Xmx865m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:PermSize=128m -XX:MaxPermSize=1
28m -XX:SurvivorRatio=3 -XX:MaxPermSize=128m -XX:SurvivorRatio=3 -Xloggc:${LOG_HOME}/${SERVER_NAME}/gc_pipe ${GC_PARAMS} "
JAVA_VM="-server"
The follwing is the output from the gc analyser perl script
Processing gc_pipe ...
Call rate = 55 cps ...
Active call-setup duration = 32000 ms
Number of CPUs = 1
DEBUG timestr: bt=60.884 et=7831.278 to=7770394
---- GC Analyzer Summary : gc_pipe ----
Application info:
Application run time = 7770394.00 ms
Heap space = 868 MB
Eden space = 130944 KB
Semispace = 64 KB
Tenured space = 757760 KB
Permanent space = 131072 KB
Young GC --------- (Copy GC + Promoted GC ) ---
Copy gc info:
Total # of copy gcs = 180
Avg. size copied = 4469555 bytes
Periodicity of copy gc = 43086.2519483333 ms
Copy time = 82 ms
Percent of pause vs run time = 0%
Promoted gc info:
Total number# of promoted GCs = 1365
Average size promoted = 2509130 bytes
Periodicity of promoted GC = 5637.85 ms
Promotion time = 54.74 ms
Percent of pause vs run time = 0.96 %
Young GC info:
Total number# of young GCs = 1545
Average GC pause = 57.99 ms
Copy/Promotion time = 57.99 ms
Overhead(suspend,restart threads) time = -10.68 ms
Periodicity of GCs = 4971.39 ms
Percent of pause vs run time = 1.15 %
Avg. size directly created old gen = 0.43 KB
Old concurrent GC info :
Heap size = 757760 KB
Avg. initial-mark threshold = 67.78 %
Avg. remark threshold = 0.00 %
Avg. Resize size = 0.00 KB
Total GC time (stop-the-world) = 133.22 ms
Concurrent processing time = 2338.00 ms
Total number# of GCs = 1
Average pause = 133.22 ms
Periodicity of GC = 7770260.78 ms
Percent of pause vs run time = 0.00 %
Percent of concurrent processing vs run time = 0.03 %
Permanent Generation GC info:
Total GC time = 0;
Total number# of GCs = 72;
Average pause = 0.00;
Periodicity = 107922.14;
Percent of pause vs run time = 0.00;
Total Old GC info (Concurrent + MS + Perm Gen):
Total GC time (stop-the-world) = 133.22 ms
Total Concurrent processing time = 2338.00 ms
Total number# of GCs = 1
Average pause = 133.22 ms
Periodicity of GC = 7770260.78 ms
Percent of stop-the-world pause vs run time = 0.00 %
Percent of concurrent processing vs run time = 0.03 %
Total (young and old) GC info:
Total count = 1546
Total GC time = 89725.68 ms
Average pause = 58.04 ms
Percent of pause vs run time = 1.15 %
Call control info:
Call-setups per second (CPS) = 55
Call rate, 1 call every = 18 ms
Number# call-setups / young GC = 273.426591796764
Total call throughput = 422444.08
Total size of short lived data / call-setup = 481217 bytes
Total size of long live data / call-setup = 9176 bytes
Average size of data / call = 490393
Total size of data created per young gen GC = 134086656 bytes
Execution efficiency of application:
GC Serial portion of application = 1.15%
Actual CPUs = 1
CPUs used for concurrent processing = 1.00
Application Speedup = 1.00
Application Execution efficiency = 1.00
Application CPU Utilization = 99.97 %
Concurrent GC CPU Utilization = 0.03 %
--- GC Analyzer End Summary ----------------
#--- Detailed and confusing calculations; dig into this if you need more info about what is happening above ----
---- GC Log stats ...
---- Young generation calcs ...
Average young gen dead objects size / GC = 131577525.92 bytes
Average young gen live objects size / GC cycle = 2509130.08 bytes
Ratio of short lived / long lived for young GC = 52.44
Average young gen size promoted = 0.00 bytes
Average number# of Objects promoted = 0
Total promoted times = 74723.82 ms
Average object promoted times = 0.00 ms
Total promoted GCs = 1365
Periodicity of promoted GCs = 5637.85 ms
Total copy times = 14868.65 ms
Total copy GCs = 180
Average copy GC time = 82.60 ms
Periodicity of copy GCs = 43086.25 ms
Total number# of young GCs = 1545
Total time of young GC = 89592.47 ms
Average young GC pause = 57.99 ms
Periodicity of young GCs = 4971.39 ms
--- Old generation concgc calcs ....
Total concurrent old gen times = 133.22 ms
Total number# of old gen GCs = 1
Average old gen pauses = 133.22 ms
Periodicity of old gen GC = 7770260.78 ms
--- Traditional MS calcs ...
Total number# mark sweep old GCs = 0
Total mark sweep old gen time = 0.00 ms
Average mark sweep pauses = 0.00 ms
Average free threshold = 0.00 %
Total mark sweep old gen application time = 0.00 ms
Average mark sweep apps time = 0.00 ms
--- Mark-Compact calcs ...
Total time taken by MC gc = 133.22 ms
Total number# of old gen GCs = 1
Total number# of old gen pauses with 0 ms = 133
Periodicity of MC gc = 0.00 ms
---- GC as a whole ...
Total GC time = 89725.68 ms
Average GC pause = 58.04 ms
Total # of gcs = 1546.00 ms
--- Heap calcs ...
Eden = 134086656 Bytes
Semispace = 65536 Bytes
Old gen heap = 775946240 Bytes
Perm gen heap = 134217728 Bytes
Total heap = 910098432.00 Bytes
## for concgc
Live objects per old GC = 0.00 KB
Dead objects per old GC = 0.00 KB
Ratio of (short/long) lived objects per old GC = 0.00
--- Memory leak verification ...
Total size of data promoted = 3344690.00 KB
Total size of data directly created in
old generation = 666.00 KB
Total size of data in old gen = 3345356.00 KB
Total size of data collected throughout app. run = 0.00 KB
--- Active duration calcs ...
Active duration of each call = 32000 ms
Number# number of calls in active duration = 1759
Number# of promotions in active duration = 5
Long lived objects(promoted objects) / active duration = 14241618.90 bytes
Short lived objects (tenured or not promoted) / active duration = 846941930.91 bytes
Total objects created / active duration = 861183549.81 bytes
Percent% long lived in active duration = 1.65 %
Percent% short lived in active duration = 98.35 %
Number# of active durations freed by old GC = 0.00
Ratio of live to freed data = 0.00
Average resized memory size = 0.00
Time when init GC might take place = 0.00 ms
Time when remark GC might take place = 0.00 ms
Periodicity of old GC = 7770260.78 ms
--- Application run times calcs ...
Total application run times during young GC = 5572109.73 ms
Total application run times during old GC = 0.00 ms
Total application run time = 5511433.32 ms
Calculated or specified app run time = 7770394.00 ms
Ratio of young (gc_time/gc_app_time) = 0.02
Ratio of young (gc_time/app_run_time) = 0.01
Ratio of (old gc_time/total gc_app_time) = 0.00
Ratio of (old gc_time/app_run_time) = 0.00
Ratio of total (gc_time/gc_app_time) = 0.02
Ratio of total (gc_time/app_run_time) = 0.01
weloadm@vwrpa41s:/var/applogs/weblogic/live/managed2/gc_128
What happens is after about 45 - 50 mins(sometimes 65-70 mins) on a load of 800 users, major gc is unable to free up any memory at all and the memory usage keeps on increasing. The above script is for the managed server that dies due to lack of memory. -
Db_load error: Cannot allocate memory
Hi
when I try to import an dump file, i always get this error:
db_load: BDB2055 Lock table is out of available lock entries
db_load: Cannot allocate memory
I executed "db_load -f outdb/outdb2 -h env xass.db"
and i have set max locks by:
dbenv->set_lk_max_locks(dbenv,1000);
but it doesn't work.
What should I do to prevent this problem?
Thanks for your help in advance
Mark
Update:
I have doing some tests, and i found that if I increase the number of locks by "set_lk_max_locks" in DB_CONFIG file, the operation of db_load will success.
The point is that the larger db file may need a very big value of locks, so why "db_load" doesn't release the locks during the running procedure? Is this a bug for bdb?
becuase I can't increase the number of locks infinity!
if not, How can i cause "db_load" release the locks of transaction?
Does anybody can help me?
MarkHi Mark,
If you are importing a dump file into an existing environment and opened with the flags of(can have more) DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN, then it is true you may see the error about "lock table is out of available lock entries" when the dump file is very big. The db_load process will not release the locks since it needs to provent other process from accessing the database being built to provide data consistency in the transactional environment.
The usually way for loading a database from a dump file is to specify an empty directory as the home directory. By this, the database will be created in a private non-transactional environment, and you can copy the database into your running environment after the db_load process finishes.
Regards,
Winter, Oracle Berkeley DB. -
Mac mini not booting up with 8GB memory after 10.7.2 update
My mac mini is not booting up with 8GB of memory after the 10.7.2 update. It just keeps on beeping and flashing the led.
If I take out the upper DIMM (Bank 1) It boots just fine, and it does so with either one of the 4GB DIMMs in Bank 0, so the DIMMs are fine. It also boots up fine with two 1GB DIMMs installed simultaneously, so the Bank 1 seems to be somehow working as well.
This trouble started right after the Lion recovery update, meaning the mini has never booted with the full 8GB installed after the update.
It worked just fine before that, with the full 8GB of memory installed.
Anyone else having similar problems?
Cheers, Otto.I have upgraded my 2011 Macbook Pro and my 2011 Mini Server
to 8 gig with Corsair RAM and have had no issues
(CMSA8GX3M2A1333C9). What brand RAM was used?
There have been issues in the past with some RAM
brands.
Something to try is a PRAM reset with the 8 gig installed.
http://docs.info.apple.com/article.html?path=Mac/10.7/en/mh26871.html
Also, make sure the Minis are booting into 64 bit mode.
Open Applications->Utilities->System Information
On the left side click the software heading. There should be a line
64-bit Kernel and Extensions: Yes
This should be the default for 2010 and 2011, but something could
have got hosed. -
I am trying to retrieve the information on my hard drive after I spilled liquid on my keyboard . I can get to Disk Utility by using the boot up disk but when I try and copy the hard drive to an external device using "New Image" it tells me it is unable to create a copy because it "cannot allocate memory".
Were you able to get any help with this problem? My MacBook Pro out of the blue wouldn't boot up all the way and now I'm trying to get a copy of everything onto the new external drive using disc utility but am having the same errors as you! Thank you for sharing any tips!! -Norah
-
Memory Leak in my JDBC application.
Hi
I am experiencing a memory leak in a test application using the JDBC-ODBC bridge to access an MS Access DB.
I close the result set, statement and connection objects after each query. Even then the memory allocated to the process increases by about 20K after each query.
Is there anything else I should do apart from closing these objects??
Thanks a lot for your time.
Fred.I am having the same problem using JDBC-ODBC bridge with the MS SQL server DB. Even after closing all of the objects as specified.
Sorry couldn't be of much help but check the following link
http://www.allaire.com/Handlers/index.cfm?ID=12409&Method=Full
But I do not have a work around for this may be I am not looking at the right response.
Can some one please help. -
Cannot allocate memory error in Oracle 10.2.0.2
I am using Oracle 10.2.0.2. When will I get the below error. What to do to resolve this issue. Can somebody help me on this
ROW-00001: Cannot allocate memory||SQLSTATE0=03/18/08 14:27:19
ROW-00001: Cannot allocate memory||SQLSTATE0=03/18/08 14:27:19
ROW-00001: Cannot allocate memory||SQLSTATE0=03/18/08 14:27:19
ROW-00001: Cannot allocate memory||SQLSTATE0=03/18/08 14:28:17Thanks in advanceROW-00001 Cannot allocate memory
Cause: There is not enough memory to run the application.
Action: Close unneeded applications or increase the virtual memory.
Or
Note:387818.1 - did this metalink note help you?
Maybe you are looking for
-
Audio output question...
Hello, Hoping someone can help guide me on the most efficent way to deal with the following scenario. I have a late 2008 alum macbook that I am using as my primary home computer. I have a toslink optical out to my DTS decoder stereo receiver so that
-
Installed (KB905474) and now my iTunes does not recognize my iPod...
First off KB905474 is a windows update for XP SP2. For me everything worked before it was insatlled, and iTunes stopped recognizing my iPod afterwards. After following the instructions for this situation I still had the problem. So I posed a message
-
Officejet Pro 8600 plus: trouble with double sided printing
I have just installed Officejet Pro 8600 plus. My iMac is running on OS X 10.9.2 I want to print a double sided brochure. And I have succeeded. However, the printing on one side of the paper is upside down. To achieve this: Print <Copies & Pages <Lay
-
My Drobo isn't being seen by Final Cut X
Anyone else have this issue. I've got it hooked up via Firewire, but no luck. Final Cut X sees my other firewire drives, no problem. This is something of an issue since the Drobo is where I'm archiving everything. Not being able to see the drive from
-
Hi All, I want to configure fast entry (PA71) for infotype 0007. I have created an entry in T588R. But for T588Q, I couln't find any fast entry standard screen for this infotype. Please help!!! Thanks, Bhaskar