Is it possible to unload a class thru the standard Classloader

is it possible to unload a class thru the standard Classloader,
I mean during runtime..

If you want do unload any class then create separate custom class loader and load it with it.
When you don't need anymore that package you can simply set your custom class loader to null and the next time GC is invoked it may free the memory.
If you want to free it right after you don't need that package anymore you should call System.gc() twice -
this usually works.

Similar Messages

  • Is it possible to unload a class?

    Suppose I take a classloader and load a class. Then I set my classloader to null and get rid of any objects of it that I've instantiated. Can that class be garbage collected?
    I'm thinking that it probably isn't possible. Even if you can get rid of all references to the class, what if a thread is running a static method of that class? But then again I suppose the stack trace would then have a reference so it can't be garbage collected. Was also thinking about what if a thread is just about to call it, but I guess you could just pop a classNotFoundException. So maybe it is possible... Can anyone comment?

    Well... I'm pretty sure it's possible to unload a class since it's possible to replace them. My IDE (IntelliJ) is capable of recognizing a change in your class file (as a result of compilation while the program is running, for example) and inserting the new class into the application if you want. This is very handy for working on web applications wherein the server takes a while to reload the application.
    So if you can reload the class, you can probably unload it, yes?

  • Possibility of unloading a entity from the cache

    Hello,
    I currently use Entities with the db-is-shared=false parameter to increase
    performance. I'd like to know if there's a way to unload all instances of a
    specific ejb in order to make manual update in the database. I do know we
    shouldn't act this way, but we cannot work in a different way. So is there a
    way to achieve unloading of an entity use MBeans or other stuff ? After
    that, I could my manual update in db and then reactiviate caching. Does the
    hot deploy feature could achieve it ? If so, does the fact that I have the
    home and remote interface of my ejbs in the weblogic classpath could be a
    problem (in my case, I just want to unload instances, not change methods
    signatures) ?
    Regards,
    Dom

    Hello,
    In my case, these Entities are not read-only and cannot be. By the way, can
    the method you suggest be applied to my use case ?
    dom
    "Dimitri I. Rakitine" <[email protected]> a écrit dans le message de
    news: [email protected]..
    You can use read-only beans and invalidate cached instances using
    weblogic.ejb.CachingHome methods. This will work in the cluster as well.
    Dominique Jean-Prost <[email protected]> wrote:
    Hello,
    I currently use Entities with the db-is-shared=false parameter to
    increase
    performance. I'd like to know if there's a way to unload all instancesof a
    specific ejb in order to make manual update in the database. I do knowwe
    shouldn't act this way, but we cannot work in a different way. So isthere a
    way to achieve unloading of an entity use MBeans or other stuff ? After
    that, I could my manual update in db and then reactiviate caching. Doesthe
    hot deploy feature could achieve it ? If so, does the fact that I havethe
    home and remote interface of my ejbs in the weblogic classpath could bea
    problem (in my case, I just want to unload instances, not change methods
    signatures) ?
    Regards,
    Dom--
    Dimitri

  • Assighning develpment class to the datasource in r/3

    hi,
    i got lot bunch of datasource in r/s which was assigned to $tmp in r/3
    i got nearly more then 200..
    is there any possible to assighn devlopment class to the datsources at a time.
    without doing one by one.
    regards
    naga

    Hi
    You can change the development class from local to the required...
    You can get it in SE03
    Also refer:
    development class
    Changing a group of objects from $tmp to a development class:
    CHANGING THE DEVELOPMENT CLASS (PACKAGE)
    Edited by: RCD on Feb 8, 2008 4:00 PM

  • Re: Possible to unload classes?

    You make a classloader that is loading classes from somewhere other than the classpath.

    ArkAvon wrote:
    Alright, what I am trying to do is to allow the user to input a java class file into a text editor within the program.You mean a java source file.
    Then the program will take the code, compile it into a classfile, and then load it via a classloader and start it executing. Now, if the user alters the code in his box and saves it again as the same filename, the same classname is used in compilation and then the classloader tries to load the new class, but it has the same name as the old one, so it just uses the old one. I need to get rid of the old one.
    So as noted you are not loading it via the custom class loader. That is a matter of the output dir being in the VM class path. It should be.
    Is the classpath just the path of the classes of the program being run? The class path is the class path. In the Sun VM it consists of a user configurable path along with the VM paths.
    Even with this set up, it still bucks it back up to bootstrap loader.Because you have it in the VM class path.

  • Loading and Unloading of Classes

    Hi All,
    I m trying to use the Digester APIs for XML parsing. Iam using the version 1.6. However, on the server where the application will be deployed, the Digester JARs already exist but an older version.
    due to some reason these old JARs cannot be unloaded or replaced with the latest JARs.
    My question is it possible to force load my new JAR and use it?
    Is it possible to unload the old JAR and reload the new one using a customised Class Loader?
    I am using IBM Websphere 5.1
    any inputs wud be highly appreciated!
    Thanksm
    gunjan sahay

    You cant unload the existing classes. Depending on how the server uses its classes you can get it to use some from your preferred library though.
    You can use a URL classloader to load your classes and use only those classes returned from that classloader. A lot of people on the Eclipse forums had to conquer the same issue.
    But i cant say if it will work. Depends on how the server finds the classes. if it asks you for the classloader, you are set, if not you are hosed.

  • Is it possible to call a class method using pattern in ABAP editor.

    Hi,
         Is it possible to call a class method using pattern in ABAP editor.
    Thank U for Ur time.
    Cheers,
    Sam

    Yes,
    Click patterns.
    Then choose Abap objects patterns.
    Click on the Tick
    It will give a new screen
    Here Give the name of the class first.
    Then the object (instance of the calss)
    And finally the method ..
    it will give you the pattern
    Hope this helps.

  • Is it possible to call a class in a jar file from JNI environment?

    Hi
    Is it possible to call a class in a jar file from JNI environment?
    Thanks in advance.

    Could you explain a bit more what you are trying to do? (In other words, your question is vague.)
    o If your main program is written in C, you can use JNI to start a JVM, load classes from the jar of your choice, and call constructors and methods of the objects defined in the jar.
    o If your main program is java, and has been laoded from a jar, a JNI routine can call back into java to use the constructors and methods of classes defined in the jar(s).

  • Is it possible to call a dll thru XI

    Hi ,
    Is it possible to call a dll thru XI .
    Thanks in advance
    Divya

    Hi Divya ,
    You can follow up these blogs and docs for your refrence
    /people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy
    /people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy
    JDBC-XI-File Scenario
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    Regards
    Abhi

  • Is it possible to override super class constructor?

    Is it possible to override super class constructor form subclass?

    However, you can achieve do something that looks similar to overriding.
    class Parent {
      Parent(int i, String s) {
        // do stuff
    class Child extends Parent {
      Child(int i, String s) {
        super(i, s);
        // do Child stuff here
    new Parent(1, "abc");
    new Child(2, "xyz");Although that's not overriding, it sort of looks similar. Is this what you were talking about?

  • HT2506 Is it possible to print separate pages on the same sheet in preview. I would like to split a set of class power points to display Page 1 and 2 on the first page, page 3 and 4 on the second page etc. Thanks in advance!

    Is it possible to print separate pages on the same sheet in preview. I would like to split a set of class power points to display Page 1 and 2 on the first page, page 3 and 4 on the second page etc.
    Thanks in advance!

    Nevermind everyone!
    I got it to work with Print Down/Across...silly me.
    Thanks anyway!
    -Arin

  • Back posting only possible with same valuation class

    Hii, I made changes in valuation class before that i closed all the open po and maintained stock zero using 201 mvt type on 31st March. Now the system is throwing error when Im doing the reversal using MB1A 202 mvt type like "Back posting only possible with same valuation class". But its taking if I take the Posting date to 1st April, and we want to post on the 31st MArch. Please provide the suggestion.
    Thanks,
    Manoj

    System is behaving correctly..
    Suppose you have changed the valuation class from X to Y as on 31.03.2014.
    So your valuation class was X as on 31.03.2014.
    But now your valuation class is changed as Y. and system will always try to post the valuation class Y for material.
    So when you are trying to reverse the entry on 31.03.2014, system shows the error..
    In that case, you should change the valuation class as on 30.03.2014 and you should do 201 movement type as on 30.03.2014, and then as on 31.03.2014, you can reverse the entry..
    Now you have to reverse the 201 movement type after date 31.03.2014.
    Regards
    Dev

  • Is it possible in an html to call the objects of a class?

    Hi,
    Please help me.I have already posted it, but it's very urgent i am in need for an working answer.
    I am calling an applet class 2 times in a browser.To share some variable i have declared as private static. But when i call these applets are called in different browsers , still these variables are shared.
    Actually i want the applets in one browser to be independent of the other applets in a separate browser. Can anyone help me to solve this problem?
    Is it possible in an html to call the objects of a class?
    Is there any some workarounds? For instance calling applets in separate JVM in the same machine.Any idea how to do that?
    Another option is using something like the session variables. But is that possible in a variable inside the applet class?
    Thanks in advance to all the solutions. Hope someone clicks an idea from the above possibilities.

    To get a reference to other applets in the same JVM (actually same browser window), do the following:
    //get a reference to the other applets in the same browser window
    java.applet.AppletContext appCon = yourAppletRef.getAppletContext();
    JApplet applet = (JApplet) appCon.getApplet(otherAppletName);or use AppletContext.getApplets() to get an enumeration of all the accessible applets. If you want to use the Session object to store your values, then, in your javascript, make a call to the applet methods. Use JSP expressions for the value of these session String values (i.e. <%= %>) to set the parameters of your applet methods. In a nutshell, it is possible. I hope this helps.

  • How to unload a class or a dll from jvm?

    We can load a class or a dll into jvm,but how can we unload a class or a dll from jvm?
    I'm look forward to your reply.
    Regard!
    Sun.Huang

    i don't believe you can unload a class.A class can only be unloaded if its classloader
    becomes unreachable, so classes loaded by the
    bootstrap loader will never be unloaded.Are they definately unloaded in that case? as soonas
    the classloader that loaded them is unreachable?or
    is it still an optional decision for the jvm?A class may be unloaded if and only if its defining
    classloader may be reclaimed by the garbage
    collector. There are no guarantees that a class will
    be unloaded.Okay, that's what I thought. Thanks for confirming.

  • Is it Possible to assign Valuation class without accounting view in MM

    Hi all,
    I have check my client system for materials having without accounting view while checking in table mbew for this material having valuation class.can anyelse say is it possible to assign valuation class without having  accounting view.
    Advance thanks,
    raraja

    Hello ,
    It is not possible to have a valuation class without accounting view.
    There is some mistake that you are possibly making . pls check the same .Pls check if u r viewing the material master at the correct plant level .Also if you say that in MBEW valuation class exists , find out l the corresponding valuation level, the see the material master at the same level . You will definitely find the accounting view.
    Regards
    Anis

Maybe you are looking for