Can we explicitly stop the garbage Collector(which is running in background
Hi all,
we can clean up some memmory using System.gc() or freeMemory(). But my query is that we have to stop the gc which is running at the background in the JVM in java.
I would request u all, to help me out in solving my query.
Thanks & Regards,
Mohan
Calling System.gc() from the code is not good development practice. You shouldn't have to worry about the GC.
Are you experiencing problems? Which ones?
-Alexis
Similar Messages
-
HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING IN THE PRODUCTION?
HI ALL,
CAN ANYONE TELL ME HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING DAILY AT 5.00 PM. I NEED TO STOP THE PROCESS CHAIN FOR COUPLE OF DAYS AND THEN RESTART IT AGAIN.
cAN ANYONE TELL ME THE PROCEDURE TO STOP THE ENTIRE PROCESS CHAIN RUNNING IN THE PRODUCTION.
THANKS
HARITHAHi,
First and foremost let me advice you to be very careful while doing this.
For Rescheduling
RSPC> chain > Goto > Planning view and
click on Execution tab > select > Remove from Schedule and then in Maintain variant of start process reschedule for the day you require it to run.
For terminating active chain
You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
The next step will be to go to targets that you were loading and remove the red requests from those targets.
Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
Re: Kill a Job
Re: Killing a process chain.
Regards,
JituK -
Using Java Program Can we know when the garbage Collector is called?
Hi all,
Can we create java program to find the time (Garbage collection time)
I want to know the time limit of Garbage collection? How did the JVm knows the object is not reachable ?
Pls help me
regards,
namancHi all,
Can we create java program to find the time (Garbage
collection time)Add "-verbose:gc" to your java command line.
I want to know the time limit of Garbage collection?Can you be more specific?
How did the JVm knows the object is not reachable ?See http://java.sun.com/docs/hotspot/gc1.4.2/. -
How to get the garbage collector to work?
Hi,
i have i program where i load an image scale it down and save the scaled version in an array. I do this for a whole directory of images.
After every image i set the temporary variable for the loaded image = null and call the function System.gc().
My problem is, that the garbage collector does�nt give the memory of the loaded image free and the used memory of my program grows with every loaded image.
/* Reads all images from a folder an stores them in an Array of images */
public static BufferedImage[] readScaledImagesFromFolder(String folder,
int maxSize) {
File dir = new File(folder); /* Open the Folder */
String[] children = dir.list(); /* Get the children of the folder */
if (children == null) {
// Either dir does not exist or is not a directory
System.out.println("No images in the folder!");
return null;
} else {
/* Init array for images */
BufferedImage[] images = new BufferedImage[children.length];
int i = 0;
int index = 0;
BufferedImage temp;
String filename, fileending;
for (i=0; i<children.length; i++) {
// Get filename of file or directory
filename = children;
/* Get the fileending of the file */
fileending = filename.toLowerCase().substring(filename.length()-4);
if(fileending.equals(".jpg") || fileending.equals(".bmp")
|| fileending.equals(".png") || fileending.equals(".gif"))
/* Read the image */
temp = util.ImageUtils.loadBufferedImage(folder+"/"+filename);
/* Scale the image down and save it in an array */
images[index] = Util.getScaledImage(temp,maxSize);
index++;
temp = null;
System.gc();
Mosaic.sourceImageNum = index;
System.out.println((index+1)+" resized pictures loaded from folder: "+folder);
return images;
How can i get the gargabe collector to work after every iteration?
I tried to let the Thread.sleep(10) after System.gc() but it does�nt help.
Thank you every much
JackNeilHm yes.. i now that System.gc() is only a
suggestion.
But i know what my program is doing and that it
does�nt need the temporary image anymore after i have
a scaled down version. And the temporay image will become unreachable as soon as reading the next one overwrites your temp variable. Setting the variable to null doesn't have much effect.
It would be smarter to load the new image over the
old temporary image and not to expand the heapsize to
maximum.Then look at the possibitly of loading the next image into the same bufferedimage. -
How intelligent is the garbage collector?
Hi all,
I've got a question about how garbage collection works in an ABAP objects context.
If there are no more references an object is cleaned up and the memory released. Fine.
What about an object O1, which in turn creates another object O2. O2 however also contains a refernce to O1.
When the original process completes, this leaves two objects that reference each other, but with no other contact to the 'outside world'. Is the garbage collector intelligent enough to dump them?
Any input appreciated,
Cheers
MikeHi,
Thanks for the feedback. I am still not sure - you say 'when the program ends it's part'. This is exactly the point - when the program ends, do the objects remain because they still contain references to each other?
More detail:
The references are public instance attributes of both objects (different classes). I would prefer to use functional methods, but am stuck with public attributes which I'm populating in the constructor.
So a process P declares a local var LV_O1 and does a CREATE OBJECT LV_O1.
In the constructor of O1, it does a
CREATE OBJECT me->ATTR_O2 to populate it's attribute with a reference to an instance of O2.
O2 doesn't need to do a CREATE OBJECT, but assigns a ref to O1 to it's attribute ATTR_O1.
So now O1 and O2 refer to each other by public attributes:
O1->ATTR_O2 and O2->ATTR_O1.
The big question is what happens when process P ends and it's variable LV_O1 ceases to exist?
In case anyone's wondering about the overall wisdom of the design, they have to be public attributes (used in Workflow) and they have to refer to each other as instantiation may also happen the other way around.
Cheers
Mike -
Every time I open Firefox, I get a pop-up asking me to install the Alexa Sparky toolbar--which I do not want. The pop-up box does not offer an option to say "no" or "do not ask me again", which is VERY annoying. How can I permanently stop the popup?
'''This worked for me:'''
How to disable extensions, Personas, and plugins
Disabling an add-on will turn it off without removing it:
At the top of the Firefox window, click on the Firefox button (Tools menu in Windows XP), and then click Add-ons. The Add-ons Manager tab will open.
In the Add-ons Manager tab, select the Extensions or Appearance or Plugins panel.
Select the add-on you wish to disable.
Click the Disable button.
Click Restart now if it pops up. Your tabs will be saved and restored after the restart.
To re-enable the add-on, find it in the list of Add-ons and click Enable, then restart Firefox. -
Can any1 provide me the script file which will genrate the X-axis label and Y-axis label ?
I have two channels and I want to create a report with 2D axis system. I do not want to drag and drop those two channels into 2D axis system. Can any1 provide me the script by which I can automate the script in such a manner that while running the script only I will get label of X-axis and Y-axis.
I tried with enabling the script but it was not able to generate X-axis label (Ex.-Time) and Y-axis label (Ex. - Speed)?
Solved!
Go to Solution.Hi Etn,
The best way to create a script which manipulates an existing layout via script is using the Ctrl-A function within the parameterization dialogs.
The following example creates a 2D axis system with one curve and sets the axis labelling explicitly:
Call PicLoad("Template") 'New layout
Call GraphObjNew("2D-Axis","New_2DAxis1") 'Creates a new 2D axis system
Call GraphObjOpen("New_2DAxis1") 'Opens the axis object
D2AxisBackColor ="grey" 'Sets the background color
D2AxisTop =10 'Sets the position
D2AxisBottom =10
D2AxisLeft =10
D2AxisRight =10
Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve
Call GraphObjOpen("New_Curve") 'Opens the curve object
D2CChnXName =ChnNameExt(1) 'Defines the x-channel
D2CChnYName =ChnNameExt(2) 'Defines the y-channel
D2CurveColor ="red" 'Defines the curve color
Call GraphObjClose("New_Curve") 'Closes the curve object
Call GraphObjOpen("2DXAxis1_1")
D2AxisXTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@] (My Speed)" ' Defines the x-label
Call GraphObjClose("2DXAxis1_1")
Call GraphObjOpen("2DYAxis1_1")
D2AxisYTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@] (My Time)" ' Defines the y-label
Call GraphObjClose("2DYAxis1_1")
Call GraphObjClose("New_2DAxis1") 'Closes the axis object
Call PicUpdate() 'Updates the report
Christian -
Swing components and the garbage collector
How much care does one need to take with swing components, with reference to running out of stack space? I ask because I'm writing a system for an automotive parts company, and the company tends to not reboot the machines very often...
Anyway... if a JFrame is closed, is it and all its components marked for GCing? Do I need to call the dispose method, or is this part of the default close behaviour? Or is there something else entirely?
CheersIn class that calls for .setVisible(false) of one JFrame u MUST call
for dispose() method.
so
myFrame.setVisible(false)
myFrame.dispose()
myFrame = null // to help the garbage collector
If u have classes that becames from JFrame (or JDialog) u can
invoke in its constructors:
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
This makes uncecessary to call for dispose() method explicetly.
If u do not have this kind of classes u can invoke this method
after u have create your JFrame
JFrame myFrame = new JFrame();
myFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
The most important thing is REMOVE ALL LISETNERS that u have added, so, if u have classes that becames from JFrame u can ovverride
the dispose method to do that
eg
public void dispose()
super.dispose()
removeActionListener(.....)
and so on
If u do not have this kind of classes u must remove all listeners u have
added before u invoke the setVisible(false) method.
Regards -
Ho w can I immediatelly stop the timer?
hello,
in my application, I am using timer.
public class newTimerTask extends TimerTask
public final void run()
initFun();
}in my program, when i enter the mainFrame, the timer must start.
I my frame, I am using one connect button. so, when i click connectButton, the timer must need to stop immediatelly.
i am using, timer.cancel();
but, the current running task is not immediately stopped.
so, the mainFrame strucked at that time, after finishing current task only, connect button effects takes place. but, also, that timer running in background.
so, how can I completely stop the timer , when i don't need.
give me some example explanations.
thank you.This is a Swing forum, so try using the Swing Timer, it has a stop() method.
Hm, sounds like the OP has long-running tasks, though, so I suspect he's just posted in the wrong forum. If so, don't use a javax.swing.Timer.
More info:
http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
i am using, timer.cancel(); but, the current running task is not immediately stopped.
Correct. It can't just pull the carpet out from under a running task because there's no interface for doing so, and stopping a thread is unsafe (see below). In order to be able to cancel tasks mid-way you would need to firstly configure the task to be able to do that (ie it needs a loop which checks a flag and exits gracefully) and then trip that flag when cancelling the timer. You might do this via either an interface, or a subclass of TimerTask, making sure that all tasks added to the timer implement/extend this.
Note that one implication of the "stopping a thread is unsafe" rule (again, see below) is that long-running tasks which are not loop-based (eg a JNI call which takes a long time) must be left to run their course - there is no way round this.
Thus, you need to decide whether you can just let your current task run safely in the background anyway, or whether you can reimplement your tasks to be more granular: the granularity defines where they can be stopped, they can't be stopped just anywhere.
More info:
http://java.sun.com/j2se/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html -
On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed? It used to fully lay out the photos so I could add notes and detailed information before I sent them. I am thinking it is something simple that I have just missed...
The "Photos" view has been replaced by the Media Browser.
Most applications will show you the Photos icon in the Sidebar, when you need to select photos in a file chooser dialoge. Mail, Safari, the iWork apps. See Terence Devlin's User Tip: How to Access Files in iPhoto
For example, in the File > Open dialogue in Preview I am seeing this in the sidebar. -
How can I find out the iCloud ID which is registered with my iPhone?
How can I find out the iCloud ID which is registered with my iPhone? I dont know which ID is actually registered with my phone Please help me
Someone logged into iCloud with his ID maybe my friend or someone but if I get the email info then I can tell him to remove the lock. The ID is started with s*****@hotmail.com. I already asked few of my friends whos name started with s but still didnt find the right one What can I do now?
-
Some of my earliest photos are not showing on my phone5 after updating to iOS7. They can be seen in the app "over" which allows for art and lettering to be placed on a photo but I cannot find an album or year for photos before 2012 (in the photo app). The iphone says the photo content is there when I check in "about" under general in settings. So the pictures seem to be somewhere but I just can't access from from the photo app. Any suggestions. I also know that they were there before the iOS7 upgrade as I was looking for a pre 2012 picture last week and it we there.
Some of my earliest photos are not showing on my phone5 after updating to iOS7. They can be seen in the app "over" which allows for art and lettering to be placed on a photo but I cannot find an album or year for photos before 2012 (in the photo app). The iphone says the photo content is there when I check in "about" under general in settings. So the pictures seem to be somewhere but I just can't access from from the photo app. Any suggestions. I also know that they were there before the iOS7 upgrade as I was looking for a pre 2012 picture last week and it we there.
-
Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?
Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
Attachments:
channel_name.JPG 69 KB -
Can anyone tell me the senarios in which database crashes
hi
can anyone tell me the senarios in which database crashes other then backup recovery concepts.when the databse goes live
regards,
swapna.sThose sort of errors would mostly be TNS errors when the database server runs out of memory (memory configured for Oracle, swapping, number of network connections limit) etc...
Other than that, if the application is written badly (which I hope is not the case), then users may face deadlock situations but those would be handled by Oracle automatically.
Of course, these errors can be handled by properly tuning the database or the application. -
I get the spinning beach ball when I open preview, it wont go away, can i somehow stop the process its trying to do?
You can quit Preview by selecting it in Activity Monitor and then clicking on the red octagon 'Quit Process'. That does not solve the issue of the beach ball' as such. Perhaps. a reinstall of the OS might sole the problem. That is simply a guess on my part.
Ciao.
Maybe you are looking for
-
Problem with soap receiver adapter
Hi All I have Idoc sender and soap receiver in my scenario. I am calling web service deployed on WAS. The web service is getting called but the acknowledgement message in xi contains following system error acknowledgement because of which xi changes
-
All me templets are in a different language ??
all me templets are in a different language. Some is in english but most is not. Can i change that ??
-
I have a problem reading unicode text files. As written in books and that stuff i should use Reader instead of InputStream for this purpose. I do so and what i get is letters separated by \u0000 chars. So what is the way to convert unicode to "normal
-
Hi there! I just got my mac back from repair (hard drive fan and graphics card have been replaced) and I got my mac back and here's the problems i've been experiencing: When I open launchpad the system freezes then does the animation in squared / rec
-
Lion Address Book question (version 6.1.2)
In Lion's address book (version 6.1.2), after importing a v-card, the application doesn't automatically navigate to the newly imported v-card (like it did in Leopard). How can I get it to navigate automatically to the newly imported v-card, right af