How to use memory management in a JAR?
I want to increase the amount of memory available to my program. It's being run from a JAR file. How can I use the java -Xms and -Xmx command line options from within the JAR? Is it a matter of altering the manifest? I'm using JBuilder, by the way.
Craig
I want to make sure I don't get "out of memory" errors. I understand that using the java -Xms and -Xmx command line options allows increasing available memory and I'd like to be able to do that when the user just clicks on a JAR file in Explorer.
Similar Messages
-
How to use application managed entity manager in EJB?
I finish reading The EntityManager Interface in JEE tutorial.
I know I can use container manager entity manager in EJB, but I want to explore how to use application managed entity manager in EJB.
Can I use application managed entity manager in EJB (container management JTA transaction is used)? Where do I should close entity manager if can?
The following is an example from JEE tutorial, but didn't find where to calose entity manager. and can I create mutiple EntityManagerFactory objects and Entity Manager objects to use them in a JTA transaction?
@PersistenceUnit
EntityManagerFactory emf;
EntityManager em;
@Resource
UserTransaction utx;
em = emf.createEntityManager();
try {
utx.begin();
em.persist(SomeEntity);
em.merge(AnotherEntity);
em.remove(ThirdEntity);
utx.commit();
} catch (Exception e) {
utx.rollback();Seems like a very poor example, the whole power of EJBs is to use Container Managed Transactions so you don't NEED to manage the transaction and the entity manager yourself. What you posted is code I would expect in a non-JEE application, or in a piece of code which requires fine-tuned transaction boundaries such as batched data importing logic.
If I were you I'd research JPA in steps.
a) learn about JPA as an API outside of the scope of EJBs (recommended reading: the book 'Pro JPA 2')
b) learn about Container Managed Transactions in EJBs
c) learn about Bean Managed Transactions in EJBs
Right now you're rushing into c). I can understand that it raises many question marks at this point. -
How to use file manager to copy music to ipod?
How to use file manager to copy music to ipod so can bypass iTunes?
You can't.
There are 3rd party apps that will load music onto your iPod. -
How to use Cache Management Library (CML) for custom applications?
Hello,
We are planning the migration of multiple applications (J2EE, Portal, Web-Dynpro for Java) from 7.01 to 7.3 and we would like to replace some custom cache implementations with a central cache management provided by the SAP Web-AS Java.
Several SAP standard services (e.g. UME, Configuration Manager, Scheduler) seems to use the "Cache Management Library" (CML):
[http://help.sap.com/saphelp_nw73/helpdata/en/4a/f833eb306628d2e10000000a42189b/frameset.htm]
Such caches can be monitored using SAP Management Console (AS Java Caches).
Portal Runtime (cache_type=CML) and Web Page Composer can also be configured to use CML:
[http://help.sap.com/saphelp_nw73/helpdata/en/49/d822a779cf0e80e10000000a42189b/frameset.htm]
[http://help.sap.com/saphelp_nw70ehp2ru/helpdata/en/13/76db395a3140fcb17b8d24f5966766/frameset.htm]
So our questions:
How to use CML for custom applications?
Is there any example or documentation available?
Kind Regards,
DirkThanks Vidyut! You've answered my question.
I placed the jar file in the $CATALINA_HOME/shared/lib directory. But where should I place the taglib TLD file? And how should I reference it in web.xml?
Currently, my web.xml is as follows and it doesn't work.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<taglib>
<taglib-uri>http://abc.com</taglib-uri>
<taglib-location>c:\Tomcat\shared\lib\mytags-taglib.tld</taglib-location>
</taglib>
</web-app>
Thanks again!
Joe -
How does object memory management works?
Hi all,
I'm having a lot of problems with memory which seems not to be released when using objects (on Oracle 9i 9.0.1.1.1). I've prepared the following test:
create type t_test as object (
id number,
member function FunctTest(TBL IN CHAR, expand IN CHAR) return varchar2
) not final;
create or replace type body t_test as
MEMBER FUNCTION FunctTest(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
BEGIN
return NULL;
END FunctTest;
end;
create or replace function FunctTest2(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
BEGIN
return NULL;
END FunctTest2;
create table tab_test of t_test;
insert into tab_test values(1);
commit;
As you can see, I create a simple type with a member function, and a schema function who does the same (nothing, in this case). Then I call the two functions with the following PL/SQL blocks:
declare i integer;
t varchar2(4000);
ob t_test;
begin
select value(a) into ob from tab_test a where a.id=1;
for i in 1..5000 loop
select ob.FunctTest('A','S') into t from dual;
end loop;
end;
declare i integer;
t varchar2(4000);
begin
for i in 1..5000 loop
select FunctTest2('A','S') into t from dual;
end loop;
end;
If you run these blocks with Task Manager opened (I use W2000) on server console, you can see how memory usage grows very fast with the first block, and how it doesn't change with the second one.
The memory isn't released till the session is alive.
I'm trying to develop an object application, but these memory leaks are making me crazy.
Geoff, does release 2 solve some of these problems?
In particular, please, do I need to free by myself temporary objects (these ones referenced in PL/SQL blocks)? In which way? I haven't found anything about object memory management in documentation...
As always,
Thanks for any support to everybody.
Andrea Arilotta
[email protected]Andrea,
Do you have an Oracle Support customer ID? If you can log a TAR on http://metalink.oracle.com with your customer id, someone can take a closer look at this problem.
Regards,
Geoff
Hi all,
I'm having a lot of problems with memory which seems not to be released when using objects (on Oracle 9i 9.0.1.1.1). I've prepared the following test:
create type t_test as object (
id number,
member function FunctTest(TBL IN CHAR, expand IN CHAR) return varchar2
) not final;
create or replace type body t_test as
MEMBER FUNCTION FunctTest(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
BEGIN
return NULL;
END FunctTest;
end;
create or replace function FunctTest2(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
BEGIN
return NULL;
END FunctTest2;
create table tab_test of t_test;
insert into tab_test values(1);
commit;
As you can see, I create a simple type with a member function, and a schema function who does the same (nothing, in this case). Then I call the two functions with the following PL/SQL blocks:
declare i integer;
t varchar2(4000);
ob t_test;
begin
select value(a) into ob from tab_test a where a.id=1;
for i in 1..5000 loop
select ob.FunctTest('A','S') into t from dual;
end loop;
end;
declare i integer;
t varchar2(4000);
begin
for i in 1..5000 loop
select FunctTest2('A','S') into t from dual;
end loop;
end;
If you run these blocks with Task Manager opened (I use W2000) on server console, you can see how memory usage grows very fast with the first block, and how it doesn't change with the second one.
The memory isn't released till the session is alive.
I'm trying to develop an object application, but these memory leaks are making me crazy.
Geoff, does release 2 solve some of these problems?
In particular, please, do I need to free by myself temporary objects (these ones referenced in PL/SQL blocks)? In which way? I haven't found anything about object memory management in documentation...
As always,
Thanks for any support to everybody.
Andrea Arilotta
[email protected] -
How to use viewslifetime managed property to get the list of sites which are least accessed?
Hi,<o:p></o:p>
I am trying to get the subsites of a site collection which are least accessed. I am using ViewsLifeTime managed property in a content search web part with a condition like this:
ViewsLifeTime < 0
OR
ViewsLifeTime = 0.
However, It is not giving any results. I even tried with ViewsLifeTime < 10. I have some subsites which are accessed less than 10 times. I came to know this when I saw the value of ViewsLifeTime
property.
Can anyone suggest how to add a condition on ViewsLifeTime property?
Thanks in advance.Hi Mohan,
Here is a thread with similar issue for your reference:
http://social.technet.microsoft.com/Forums/en-US/770f100d-eadb-45d1-9305-15f11cf9038d/ctxcurrentitemviewslifetime-is-showing-null?forum=sharepointsearch
If you would like to get site usage report in SharePoint 2013, there is OOTB feature for you to view popular trends report for a site, you could refer to the link below:
http://blogs.technet.com/b/tothesharepoint/archive/2014/01/28/view-and-configure-usage-analytics-reports-in-sharepoint-server-2013.aspx
In addition, custom script for usage report for SharePoint sites might be more helpful to your requirement to know access times:
http://blog.falchionconsulting.com/index.php/tag/audit/
Regards,
Rebecca Tu
TechNet Community Support -
How to use Template manager in Adobe Designer
Hi,
I am new to WebDynpro. I am trying to import templates in Webdynpro Adobe Designer.
In the Interactive Form Designer, there is a Menu called "Tools", which has option "Template Manager".
When I select a template there is only a buttion Set Selected as default after i click it but nothing happen!! Can anyone please let me know how to use the Template Manager?
Thanks.
Edited by: bo wang on Jan 15, 2008 9:34 AMYes, here you dont have option of using standard template. In this case, just right click on the Project name shown in WD perspective on the left hand side of screen and check the Projectlocation in Properties --> Info.
go to "Projectlocation"\src\configuration\Components. Here you can find the XDP file. Open this XDP file, in this XDP you have File option. Select the template, and save the file.
This change will appear in WD.
With regards,
Amit -
How to use the Managed Review and Approval
Hi,
I'm a RIA Consultant at iDA MediaFoundry, Adobe Gold Partner in Belgium. I'm trying to figure out how the new solution accelerators work and how we can use them in the solutions that we develop for clients.
I'm a bit stuck though with the Managed Review and Approval solution accelerator. I cannot figure out how the application actually works, how it communicates with livecycle and how we can use this application in our projects for clients.
Does anyone have a tutorial or a document on how to use this solution accelerator? I know this is a rather big question, and the answer will be even bigger, but I really could use some help from anyone who knows how to use all this.
Thanks in advance for your answer.
Kind regards,
Ronald KampI would also suggest that you look at the resources on devnet.
http://www.adobe.com/devnet/livecycle/testdrive.html (see the Managed Review & Approval)
as well as the downloads and full documentation http://www.adobe.com/devnet/livecycle/solutionaccelerators.html -
How to use an Applet with multiple-jars
Hi everybody,
I would like to use an applet with multiple-jars.
ex:
<applet codebase="." archive="main.jar,Addon1.jar,Addon2.jar" code="Appl.class" id="MyTest" width="600" height="30">
<param name = "MyParam" value = "1;2">
</applet>
An applet with :
-> 1 Main JAR
-> X Addon JARs (X : a parameter "PRM")
My main part knows the parameter "PRM" -> knows which addon to use
My question is, how do I use classes from addons, inside the main part (and vise-versa if possible) ?
Thanks in advance
Best regardsI try what you say :
=== HTML ===
<applet codebase="." archive="Main.jar,Addon1.jar" code="Test.Appli.class" id="MyTest" width="600" height="30">
<param name = "myPrm1" value = "1;2">
</applet>=== MAIN JAR ===
package retest;
interface InterfAddOn1 {
public void AfficheTest1(String sStrTest);
public class Ctest {
public Ctest() {}
public void unTest(String sClassNameR) {
String sClassName = "PackTestAddon.TestClass1";
try {
Object oObj = Class.forName(sClassName).newInstance();
((InterfAddOn1) oObj).AfficheTest1(" Hello World ");
} catch (ClassNotFoundException ex1) {
System.out.println("ERR Class not found");
} catch (IllegalAccessException ex1) {
System.out.println("ERR Illegal Access");
} catch (InstantiationException ex1) {
System.out.println("ERR Instantiation Exception");
}=== ADDON JAR ===
package PackTestAddon;
public interface InterfAddOn1 {
public void AfficheTest1(String sStrTest);
package PackTestAddon;
public class TestClass1 implements InterfAddOn1 {
public TestClass1() {}
public void AfficheTest1(String sStrTest) {
System.out.println("Test :"+sStrTest);
}I have this error :
Exception in thread "AWT-EventQueue-2" java.lang.ClassCastException: PackTestAddon.TestClass1
at retest.Ctest.unTest(Ctest.java:58)
at retest.Appli.actionPerformed(Appli.java:442)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I don't really know why ... =;o(
Helppppp ... Thanks in advance. -
How to use memory analyser in CE 7.1 portal
Hi,
I want to use Memory Analyser in my landscape, i have installaed CE7.1 on oracle DB( remote DB) on my VM.I have downloaded the memory analyzer from the eclipse site and i have the memory analyser.exe file with me. How can i use this one to use in my server case. Currently i have installaed SAP JVM_5, and how can i get the heap dump from my SAP JVM and how can i import those hepa dumps in to my memory analyzer on the virtual machine.
Regards,
Pradeep JHi,
there are varios ways to get a heap dump. Have a look at this page:
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=33456
If you want to trigger a heap dump on your own, ust the jvmmon tool from the SAP JVM.
Then you need to copy the heap dump to a place where Memory Analyzer can open it. In Memory Analyzer just ust the File -> Open Heap Dump menu.
Does this help?
Regards,
Krum -
How to use varaibke manager option at RPD in obiee 10g
Hi
At RPD level , can anyone please help on uderstanding how to use the variable manager.
thank youHi,
System session variables:
System session variables have reserved names, that cannot be used for other kinds of variables (such as static or dynamic repository variables and non-system session variables).
e.x:
1)
if u want to get and display user login ID,group,timezone...Date and time...etc... can be done by using session variable
2) Exteranl application integration ( java -jsp) by using go url.
here u can specify the session variable and it will passed into Java apps.
3) setting log level by using session varaible
4) u can use it report tittle/header..etc
for more:
http://obiee101.blogspot.com/2008/02/obiee-adding-session-variables-to.html
http://obiee-blog.info/administration-tool/how-to-set-session-variables-using-url-variables/
http://sureshotstrategies.blogspot.com/2008/07/about-session-variables-in-obiee.html
http://inetskills.com/obiee/obiee_11.php
Thanks
Deva
Edited by: Devarasu on Dec 6, 2011 5:10 PM -
How to use solution manager in upgrade projects
Hi,
How to utilize/use the solution manager in upgrade project like R/3,BW,CRM or entire landscape.
if we are upgrading the r/3 4.6c to ecc6 and bw3.5 to bi7.0 how to use the solution manager
please help and thanks in advance.
Edited by: MAHIPAL REDDY on Jan 1, 2009 1:28 PMHi,
Check [this document|https://websmp208.sap-ag.de/~sapdownload/011000358700002696532005E/310_320_SOLMAN_URMP_EN.doc]. This will help you to proceed further.
This is a detailed documentation on using Solution Manager for your upgrade project.
This will solve your problem.
[This Pdf |https://websmp208.sap-ag.de/~sapdownload/011000358700000208052007E/Upgrade_FAQ_SolMan_70.pdf]of FAQs on upgrade project is rich in information.
Feel free to revert back.
--Ragu
Edited by: Raguraman C on Jan 3, 2009 5:27 PM -
How to use memory analyzer On Virtual Machines
Hi,
I want to use Memory Analyser in my landscape, i have installaed CE7.1 on oracle DB( remote DB) on my VM.I have downloaded the memory analyzer from the eclipse site and i have the memory analyser.exe file with me. How can i use this one to use in my server case. Currently i have installaed SAP JVM_5, and how can i get the heap dump from my SAP JVM and how can i import those hepa dumps in to my memory analyzer on the virtual machine.
Regards,
Pradeep JI don't know. I've never tried.
Look at the manual (7210midpSimGuide.pdf in the docs directory). Maybe there is something in there. In the command line options there are a bunch of tracing options that you can specify, like tracing allocations, garbage collections, stackmaps, etc.
shmoove -
How I fixed memory management fails on Lion
MAC:
17" i7 2.66GHz Macbook Prom Mid 2010
SYMPTOM:
The Free memory was always dropping and I needed to use FREE MEMORY APPS from Apps Store. The beach ball was frequent. The speed is so slowly from OS X Snow Leopard, even I made a Permissions Fix, it takes a lot to start and shut down. The memory drops on every app I open and the system can't free them after I quit the apps.
WHAT I DO:
I made a backup, formated and installed a free new copy of OS X Lion and SOLVED all the memory drops.
IMPRESSIONS:
I have 8GB of RAM in my and now I see at least FREE 5.5GB RAM CONSTANTLY (navigating web, without use of huge memory hungry background apps). I'm another 17" MBP Mid 2009 owner with 4GB RAM and noted that it was faster. Both with the last version of Lion. Not now after the new copy of Lion my mac is pretty fast again There is no aparent issues about Lion Memory Management as people are discussing.Yes, a brody and thanks for your link. In this Mac I installed an old HP scanner driver
I'm very concearned about people saying don't upgrade to Lion, it's a big liar! You don't need to put your mac to sleep as people said to don't waste time on boot. I imagine boot process is very useful for system reset and evaluate hardware status.
I made a lot of reboots to certificate the speed boost, I imagine the system makes it to diagnose any problems and fix itselves.
I feel the boot and shutdown is becoming fast as I use it since the first boot of reinstaled Lion.
Only one issue (solved) is about installing Epson printer that couldn't print wirelessly.
It was solved just clicking at OSX X UPDATE SOFTWARE and it discovers an needed Epson Driver Update for Lion.
Very happy again with my mac. -
How to Use Solution Manager to collect Status Reports from Consultants
Hi,
I am planning to use Solution Manager for collecting the weekly status reports from my consultants and maintain it as a repository . Please let me know the best way of doing this in SOLMAN. There should be mailing options too.
BR,
RajHi Rajasan,
to be able to meet this requirement, you need to set up plan working load in admin tab for your resource, they need to update actual data based on the work completion, you will get status of work,
if you require email, you need to set-up scot, then develop a program with execution scheduling
please check and revert
Anil
Maybe you are looking for
-
Can anyone tell me how to I get an old account information and recorded messages from a conversation
I am totaly confused by eircom and efibre.......last year I was in arrears with eircom to the tune of( as I thought) of €357.66and I was disconnected but in the long run I got a huge bill in my door of €656.48 , when I had to the money to pay the or
-
ITunes is continually opening itself
ITunes is continually opening itself, and prompting me to reverify my iCloud account. I have never used iCloud. How do I get it to stop? I'm being tortured by it, it interrupts everything constantly. I've tried force quits, continually scrubbing
-
Push workflow notification in gateway
Hi All, I want to push workflow notification to external server via Gateway system , I have followed some links for push notifications made easy . Here i need to know , what is the exact report or badi i need to implement for push notifications ? I
-
Report Server Web Site isn't Working (Incorrect security descriptor version)
Hello, we have microsoft sql 2012 sp1 on windows server 2012 64 bit. and we have scom 2012 sp1 we had use the reporting sevices succesfully. somehow it gave an error that "An internal error occurred on the report server. See the error log for more d
-
I have no audio on my export, but ONLY on the portion with an after effects clip
Hi, My footage is AVCHD 1080p MTS files taken from a Sony FS100. I am attempting to export via media encoder using the 1080p 29.97 FPS YouTube Setting. I threw together a premiere project and sent a couple of the clips to after effects to add some a