Suggestion for increasing the chance of Garbage Collection

To increase the chance of GC, I usually use the following approach to call GC to clean up the memory:
Test testObj = new testObj; // Suppose it is a very large object
/* after some complex processing */
testObj = null; // make the Object (memory location) unable to be referenced and then become a candidate for GC
System.gc(); // Call GC to clean up the memory
Is this approach always reclaim the memory used by testObj as I expected?
Any other good practices for GC in Java Coding (not JVM tunning)?

To increase the chance of GC, I usually use the
following approach to call GC to clean up the
memory:
Test testObj = new testObj; // Suppose it is a very
large object
/* after some complex processing */
testObj = null; // make the Object (memory location)
unable to be referenced and then become a candidate
for GC
System.gc(); // Call GC to clean up the memory
Is this approach always reclaim the memory used by
testObj as I expected?
Yes, but is usually a waste of time since if the variable goes out or scope the same thing will happen.
>
Any other good practices for GC in Java Coding (not
JVM tunning)?
The best general strategy I have found is to do nothing at all.

Similar Messages

  • Increasing the priority of garbage collection

    We have a JNI application that is running under a very heavy load. The problem is that the garbage collection can't catch up with the application. This creates a problem that looks like a memory leek, we consume more and more memory.
    Is there a way to solve this? Perhaps by increasing the priority of the garbage collection thread?

    We have a JNI application that is running under a
    very heavy load. The problem is that the
    garbage collection can't catch up with the
    application. This creates a problem that looks like a
    memory leek, we consume more and more memory.
    Is there a way to solve this? Perhaps by increasing
    the priority of the garbage collection thread?Addressing this is detail.....
    First normally the JVM is free to grab all the memory that it is allowed to. It doesn't have to give anything back to the OS, regardless of whether it is using it or not.
    There is a way to tune that but I doubt that is going to help you because if you are actually using the memory (which a "very heavy load" would suggest) then the VM needs the memory.
    Secondly why do you consider this a problem? If you are getting an out of memory error then either you have a memory leak or your application needs more memory. And in neither case is the gc going to help.
    Now perhaps what is really happening is that you are getting a full gc and that is impacting the application. And you are hoping that there is someway to make the incremental gleaner run faster. There might be. It would be one of the XX options. But again this, in of itself, is not going to normally return memory to the OS.

  • My MacBook Pro is all of sudden having issues with pop up ads.  I am running OSX 10.5.8.  Any suggestions for fixing the problem?

    All of a sudden I am getting TONS of pop up ads.  I am on a Macbook Pro running OSX 10.5.8.  Anyone have any suggestions for fixing the problem?

    Take a look at my Adware Removal Guide.
    (Fair disclosure: The Safe Mac is my site, and contains a Donate button, so I may receive compensation for providing links to The Safe Mac. Donations are not required.)

  • Suggestion  in increasing the SGA and PGA after increase in the RAm of the machine .

    Hi All,
    Need an expert suggestion on the change's  in the SGA and PGA of the oracle database after increasing the size of the machines RAM .
    We have 64G of RAM in the machine .
    There are 9 DB's running on  oracle 10g  and 11g  on  this machine
    The total SGA of all the database's is around 18G .
    DB1  has 2G of MAX_SGA_SIZE
    DB2 has  8G  of MAX_SGA_SIZE
    DB3 has 1G   of MAX_SGA_SIZE
    DB4 has 2G    of MAX_SGA_SIZE
    DB5  has 676M   of MAX_SGA_SIZE
    DB6   has 1.5G   of MAX_SGA_SIZE
    DB7 has  1.2 G   of MAX_SGA_SIZE
    DB8 has  675M   of MAX_SGA_SIZE
    DB9  has 672 M   of MAX_SGA_SIZE
    Now the machine RAM is up  to  96G  64+ 32
    what would be the suggestion on the increase in the SGA and PGA max size .
    Any expert suggestion is highly apprciated .
    Thanks in Advance

    Thanks for this Justin.
    Here the exercise is to add 4 CPU's  and 32G RAM to the server  earlier it was with 4 CPU's and 64G RAM  this was decided  by the server support team .
    here is the stats from SAR   command ..
    The platform is
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    04:00:01          CPU     %user     %nice   %system   %iowait    %steal     %idle
    04:10:02          all     86.47      0.00     12.52      0.99      0.00      0.02
    04:20:01          all     84.83      0.01     11.80      3.21      0.00      0.15
    04:30:01          all     76.23      0.00     10.30     12.34      0.00      1.12
    04:40:01          all     79.14      0.00     12.07      8.30      0.00      0.49
    04:50:01          all     77.63      0.00     12.19      9.40      0.00      0.77
    05:01:01          all     75.95      0.00     10.50     12.80      0.00      0.75
    05:11:01          all     83.21      0.00     11.98      4.54      0.00      0.26
    05:21:01          all     76.37      0.01     11.20     11.49      0.00      0.94
    05:31:01          all     77.97      0.00      9.04     10.30      0.00      2.69
    Average:          all     79.72      0.00     11.28      8.20      0.00      0.80
    Now that the 4 CPU's and RAM is been added , my request is how to  calculate the required kernal parameters for oracle  to this new configuration  for some improvement in the oracle performance .
    like kernal.shmmax
          kernal.shmall
    /dev/shm file system
    largest value of MEMORY_MAX_TARGET or MEMORY_TARGET of all instances
    the oracle is set as automatic memory management . it is not an RAC environment .
    Any Expert suggestion is highly apprciated .
    Thanks in advance .

  • Suggestions for debugging the event queue

    Hello,
    I have an issue where an exception is thrown inside the AWT-EventQueue-0 and I can't quite figure out where it's coming from. I can replicate it relatively easily, but the action that I do to replicate it actually does all kinds of stuff behind the scenes so it's not so easy to sort out what's going on. I'm debugging with eclipse if it matters. The stack trace mentions none of my code and only mentions java library code. I tried overriding dispatchEventImpl in the components I wrote that are involved in the aforementioned action that causes it to happen, with hope of catching the exception in there and putting a breakpoint or something to give me a clue, but apparently dispatchEventImpl cannot be overridden (not sure why). Ofcourse, once the EventQueue dies from this exception so does the rest of the GUI so that's no help either. I tried adding a break on uncaught ClassCastExceptions and make the break suspend the whole VM instead of just the one thread, and then I look at the two processor threads involved with the action above and that wasn't too much help, they were sitting waiting to read something from the queue, meaning it whatever is happening in the EventQueue is delayed enough that I can't rely on catching it that way. Any and all suggestions/hints/etc are highly appreciated.
    The components in question have a panel that's a Box (vertical) that contains subpanels, each with a title and a table (and those subpanels can be expanded/contracted to show/not show the table), the tables are sorted by one of their columns, the panels are sorted by the title, and panels/table rows are added and/or removed by messages coming in from a remote server. The user can click a button to "accept" a table row (which may appear in several of the subpanel tables) at which point the server is alerted to this, and any place this row is shown is removed).
    Here is the stack trace (i hope there are no typos, I had to retype it since machine code is on can't be networked to internet):
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
    at javax.swing.LayoutComparator.compare(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.mergeSort(Unknown Source)
    at java.util.Arrays.sort(Unknown Source)
    at java.util.Collections.sort(Unknown Source)
    at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Unknown Source)
    at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(Unknown Source)
    at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(Unknown Source)
    at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(Unknown Source)
    at java.awt.FocusTraversalPolicy.getInitialComponent(Unknown Source)
    at java.awt.Window.getMostRecentFocusOwner(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.SequencedEvent.dispatch(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 believe I maaaay have figured out what's going on, though I'm not sure how to go about fixing it, heh.
    Ok, so the Box that contains all the subpanels, I'm trying to keep sorted by title of the subpanels. For this reason (and other cross-referencing reasons) I keep a Vector of the object from which the title is constructed in the panel containing the box, as well as a Vector of the subpanels. When I wish to add a new panel I first add it to the Vector (and the title object to its Vector), then I sort those Vectors, then I do a removeAll() on the Box, then re-add the subpanels to the Box while stepping through the subpanel Vector, that way I'm guaranteed they are in order (actually it's probably unnecessary to keep the title vector in addition to the other one, I just haven't gotten around to trimming that kind of stuff out since I've been dealing with this issue). And it works fine.. seemingly.
    constructor()
      anEntry = new Vector<MySubpanel>();
      myTitlesVector = new Vector<TitleObject>();
      boxPanel = new Box(BoxLayout.Y_AXIS);
    //this function is called from a protected one that constructs the anEntry, makes sure it should be added, and does a synchronize on panelVector
    private void addEntry(MySubpanel anEntry)
      if(anEntry != null)
        try
          if(panelVector.add(anEntry))
            Collections.sort(panelVector);
            myTitlesVector.add(anEntry.title);
            Collections.sort(myTitlesVector);
            boxPanel.removeAll();
            for(int i = 0; i < panelVector.size(); i++)
              boxPanel.add(panelVector.get(i));
        catch (IllegalStateException isex)
          //couldn't add it
    }So what's the problem?
    Well, clicking the "accept" button I mentioned in the first post pops up a dialogue frame, which when the user OKs tells the server and other places in client that it was accepted. But when that dialogue box goes away the focus comes back to the main client frame. Well, that kicks off that sequence of calls in the event queue I put in the first post. If it just so happens that that topmost call is being performed on this panel containing the Box after the Box has gotten the removeAll() call, but before it's been filled back up to full, one or more of the MySubpanels will have a null for a parent, which causes the LayoutComparator to throw a ClassCastException.
    So, I guess my question would be, is there a better way to maintain order in the Box (one in which the components stay in there, but are just moved around)? I can't pass the Box itself to Collections. Is there a way to move components around what order they are in right on the Box?
    Thanks!

  • Need a Suggestion For implementing the Digital Signature For the Documents

    Hi,
    Currently I am working in a Document Management System. I need a Good Suggestion for how to implement a Digital Signature For the Documents.
    Thanks in Advance
    Sabarish V

    Hmm, if you are not using Oracle Payroll, what are you using for payroll? I am wondering why you could not use your payroll system, whatever it is, to handle this reimbursement program.
    Well, you may want to talk to Oracle support about how to handle this in Oracle iExpense. You can certainly handle advances for Expense Reports. You would then apply the advance to the expense report items. The catch is I don't think you can stop expense item entry after the adavance is satisfied. You would have to set up a work flow process of some kind to have the expense reports reviewed and only approve expenses that are applied to the advance, is what I am thinking. Not your ideal solution, but something to think about. It could be the Oracle folks might know of a sneaky way to handle this. What you are trying to do is unusual. Employee advances are common, but the idea of not being able to exceed the advance amount is what unusual about this. Normally you will accept any expenses over the advance amount and reimburse the employee for those extra amounts not advanced.
    Good luck.
    John Dickey

  • Book Suggestion for Making the Most of Soundtrack Pro

    I have worked with Soundtrack Pro quite a bit but never seem to be able to get the results that I want. I was wondering if anyone had a suggestion for a book or books that would help me make the most of this program? I have problems with removing background noise sometimes I mess around and can get decent results but I feel there are common techniques I could use that I just don't know about. Are there any books that would just give me an overview of ways to make audio sound better? Then I can apply it to SP. I know this is not a tech SP question but I figured someone might have a suggestion

    I want to preface this remark by saying that I'm a college prof. who teaches this stuff. I DEMAND that my students join LYNDA.COM for their excellent tutorials on seemingly anything and everything. The SOUNDTRACK PRO series is taught by Larry Jordan, an excellent teacher, and a "Sound" enthusiast. The tariff is only 25 bucks a month, and in two months, you'll be on your way. The best texts go for around 80 bucks, so cancel in two months and you're golden. I also recommend bookmarking parts of the Apple User Manual that are "off the main usage stream." example: Noise Reduction, Page 225, is a common destination for my students.

  • Day 3 - A Suggestion for Improving the Ease of Use...

    OK, It's day 3 and I'm beginning to appreciate the advantages of the new forum.  Overall, I have to sa that I like it a lot.
    However (there's often a 'however') the information columns to the right of the 'Subject' are counterintuitive and confusing.  I'd like to suggest reorganising them.
    They would be much more useful and informative (as well as being easier and more logical to read and interpret) if the columns were laid out in the following order:
    Subject                     Latest Post               New (Replies)           Replies            Author Ratings
    The reasoning behind this is as follows.  After knowing what the subject is (and thus whether you are interested or could help) and whether the question is answered or not, its then useful to know who last contributed and when, then whether there have been any new replies since you last looked at the thread.  The total number of replies and ratings are very much secondary issues.  To that end, the layout of the old forum threads were much, much better.
    What do others think?
    "To forbid us anything is to make us have a mind for it."
    -- Michel de Montaigne, Essays, 1559

    Could I offer a quick suggestion.
    Make the 'solved' button clearly visible rather than in the options menu.
    Maybe create a little icon asking if your question has been answered.
    Some threads are answered but appear not to be. (Thread creator has replied but may not know where it is).
    -+-No longer a forum member-+-

  • Moving toward a click-less OS: a suggestion for improving the Mac interface

    This is a long post, so if you have a short attention span, or are not interested in UI design, have a nice day and move on to the next post!
    A little history first. Back in the days of OS 7 and earlier, I recall a feature lacking from the OS that was really important. For a long time, Apple did not use sticky menus, and you had to use a third-party extension to have the ability to click once on a menu heading and have the pop down menu display and stay there without having to hold the mouse down. Around OS 8 or so I recall that they made sticky menus part of the OS and all applications, and that was a welcome ergonomic improvement. No need to click and hold when we explore menus. What I plan to talk about in this post is a similar improvement -- one designed to facilitate the easy exploration of files and folders while completely eliminating the need to click at all.
    My idea was inspired by another feature of OS 8 (or thereabouts). This was the ability to display the files in a folder as buttons. This allowed the user to launch the application/file with a single click, rather than the ergonomically bad double-click required in previous OS's. (You could still select a file without launching it by clicking the label rather than the icon.) This very useful feature went away in OS X. So one is back to double clicking to launch all documents, photos, movies, or whatever. If you are editing hundreds of pictures in a folder as I am, and double clicking them to launch PREVIEW for a quick inspection, you start to develop problems with the tendons in the wrist. I have to switch hands regularly to deal with the fatigue.
    The elimination of buttons was a huge step backward for me in OS X. It is simply not acceptable to have to double click files to launch them. I think a future OS -- truly improved, not just one with more flash -- must solve this problem. As I thought about how it should be implemented, I realized there is a much better and more general solution than that offered by buttons. One that allows the examination of files without ever clicking at all.
    Imagine a folder with multiple file types: photos, mp3's, movies, text edit files, etc, and assume the files are displayed as icons (although my suggestion would work with list view as well). You see a jpg thumbnails and want to see some of them at full size. Or you see a song and want to hear it, or a movie and want to view it. Now imagine that there is a special "preview" mode which allows you to easily and quickly examine the contents of the files without having to launch them in an application by double clicking, then close the window with another click, go on to the next icon of interest, and do this again, and again, and again until your hand is ready to fall off. Instead, you toggle an assigned key (say F5), or select an appropriate menu choice in the Finder, in order to activate what I shall call dynamic preview mode (DPM). With DPM, whenever you move the cursor over a file icon you get a preview. For example, moving the cursor over a jpg file would immediately expand it to full size on the screen. The image would stay up for as long as the cursor remained over the file's icon (which may not be visible). Moving the cursor off the icon causes the preview image to "collapse" back into the file icon. Moving the cursor over another jpg would cause its image to expand to full size until you moved on to the next, and so on. Note that you are able to view ALL of the jpg images without ever clicking the mouse once, well enough twice. There isn't any way I can think of to make reviewing large numbers of images easier. All you have to do is move the mouse around and the images appear and disappear dynamically, without you doing anything other than moving the mouse. Since you would have to do that anyway to select a file for launching under OS X, DPM brings the effort down to the bare bones minimum (short of using a slide show -- but that has other problems, which is why I don't use it except at the end for the fully edited pics). Think of DPM as a super convenient way to browse images without launching applications, closing windows, double-clicking, and so on. When you find an image that you might want to do something with, say edit the color balance in Photoshop, you then launch it using the appropriate application.
    Of course, applications are indeed launched during DPM. But not in the usual way. No doubt the Preview app would be used to handle the display of the jpg's in DPM but it would be modified somewhat for dynamically viewing images. When the cursor goes over a jpg, Preview opens it and displays it, but not in the usual window with a close box, but just as a simple untitled pane showing the image. And as soon as the cursor moves the pane disappears. Likewise, there is no Preview menu bar showing at the top of the screen, because Preview is only used for dynamic display, not editing of the jpg. Now, the user might want to launch the parent application when placing the cursor over the icon because they want to use the application to do something with it (besides viewing or listening). No problem. We simply design DPM so that when the option key is pressed while the cursor is moved over a file icon, it fully launches the application with the file, just as it now does when you double click the file icon. You get the usual titled window, application menu bar, etc. But note that you get the application running with the file loaded without having to double click. This click-less OS interaction, of course, could be implemented right now since it is a only a minor tweak on the OS.
    What about other file types? Putting the cursor over an mp3 file (or other supported format) would start playing the song, and putting the cursor over a movie file would start playing the movie, again in an untitled pane. Presumably Quicktime would be used to handle both of these latter two tasks, but without launching in the usual way and taking over the menu bar. Putting the cursor over a text or RTF file would display it in a pane (possibly using Text Edit). More complicated file types (word processor, spreadsheet, statistical, etc.) would probably not be supported in a first-generation DPM. But jpg, mp3, mov, txt, and rtf files could be easily handled using just three applications that come with every Mac. Also, "compressed" stickie notes could now be deposited individually anywhere, in any folder or on the desktop, and putting the cursor over the note would expand it to full view. With the current OS, we need to run the stickies app which displays ALL the sticky notes at once, and which constrains them to the desktop only, both of which are serious limitations.
    Of course, once we have DPM users will want to complicate things -- they always do. For example, they'll want the mp3 preview to have a play bar with a bug to position in the song, volume control, etc, just like the Quicktime player. But be careful what you ask for, or we are right back with full fledged apps loading with a menu bar and a window that has to be closed, and that defeats the point of a click-less preview. This is because any interaction the user might wish to have with the viewer or player will require moving the cursor, and in DPM that would normally cause the preview to cease. That's the point, after all. So I would argue that dynamic preview should be kept very simple: cursor on the icon opens a preview, cursor off the icon closes the preview.
    Would this be enormously difficult to do? No. It is already being done -- kind of. For any of the file types discussed above, you can click on the file icon, then press command-I (Get Info), and you will see a preview at the bottom of the info box. If it is a pic, that's all you get. If a song or movie, you can play it. Unfortunately, if it is an rtf file, no preview is displayed -- kind of odd, that. (How hard is it to display some text?) The only thing not offered in the command-I previews for pics and movies is a full (or at least larger) screen preview. But that shouldn't be too difficult since Preview and Quicktime allow that as a matter of course.
    Oh yeah. We can add folder icons to the list of icons supported by DPM. Right now, if I want to quickly peek at some folders just to see what they contain, I have to double-click each one to open it, and then click on the close box to close it again. With dynamic preview activated, all I would do is move the cursor over the folder icon and it would immediately expand to its usual size showing whatever contents can be seen in that view. Moving the cursor would make the folder collapse again. Again, all that is need to examine the contents of folders would be to move the cursor around. That's it.
    (Don't get greedy -- you might want a scroll bar for the folder preview, but that defeats the point of a quick preview and would require cursor movement which, with DPM, would close the folder preview. Again, holding the option key down while placing the cursor over the folder icon could open the folder in the usual way, without needing to double click. But as with option-launched previews for images and the like, you will have to close the preview window yourself.)
    Now, I do not think think dynamic preview should be activated out of the box, at least not at this point. Inexperienced users will be confused to see things popping up on the screen when they are moving the cursor around (or hearing songs). But for experienced users who have thousands of files archived in dozens of folders who need to quickly and easily examine them without the steps required now -- double-click, look or listen, close -- this would be a real improvement in the UI, one that would really make a difference. One, that once a user tried it (just like the first Mac OS) would make them say "I'll never go back!"
    In closing, I must post a question, or fear being chastised for not following discussion group rules. So, what are the technical obstacles to doing what I am suggesting, and who else would like to see it done? (And, yes, I am sending these suggestions to Apple, so no need to tell me that.)
    Drake

    BDAqua wrote:
    I agree with you totally... except the clickless preview though, since Apple doesn't like to give you options to turn stuff off or not use it at all if they go to the trouble of putting it in the OS!
    Well, they give you the option to display the contents of a folder in list, icon, or column view. So why can't you have the option to view files with and without dynamic previewing? It is the dynamic equivalent (off vs on) of the static options provided by list, icon, and column view. Also, by the logic you give above (for Apple), one should not have preferences, because that makes the functioning of the OS or app different from one user to the next. And as a counter example, the features of the OS for people with disabilities are great to have, but they are not active just because they are there. One has to want to use them...
    And if you think about it, Expose is an optional utility, as is Dashboard. Some people use them, some don't. DPM would be the same.
    Every new OS release makes me spend a lot of time learning how to shut off/disable things like Spotlight, Dashboard, Time Machine, Transparent Dock & Menubar, ad infinitum!
    Me too. Although I have learned to like Spotlight (although it has bugs), and the dock.
    Did I ever tell you Leopard's System Preferences icon in the Dock looks like a Skull & Crossbones to me?
    If you close one eye & squint the other one until it does to you, then you'll get an idea what OSX looks like to me... LOL.
    I tried, but couldn't conjure it up! I must have too limited an imagination.
    BTW, Are you aware you can select as many things to view at once as you want & drag them to say Preview's icon?
    Sure. Have you ever selected several hundred pics and launched preview? Ca-chunk, ca-chunk, ca-chunk, wheez! It is quicker and less demanding of system resources to view one jpg at a time, unless you want to compare them in some way or do a slide show. But for just exploring the files, I want to do it one at a time, especially if iTunes is playing in the background, Photoshop is running and waiting to load a pic that I might decide to edit, mail is up to let me know if anyone is trying to reach me (ding!), Safari is running so I can follow Apple Discussions, etc. In other words, a lot is going on. No need to make matters worse by loading a bunch of pics into Preview, when I am happy to view them singly. This is why I object to the Cover Flow aspect of Quick Look and Safari 4.0. It is just another way to dog down limited system resources.

  • Suggestions for increased performance and better memory utilization for FTE

    We all know that there is a pretty big downside to creating potentially thousands of DisplayObjectContainers (TextLines).
    o - they are slow to create
    o - they may be short lived
    o - they occupy lots of memory
    o - they may need to be generated frequently
    Currently, there is only one way to find out all the information you need and that is to create all the TextLines for a given data set.
    This means that FTE does not scale well. It becomes very slow for large data sets that need to be regenerated.
    I am proposing a possible solution and hope that Adobe will consider it.
    If we had the right tools we could create a sliding window of display objects. With large data sets only a fraction of the content is actually visible. So only the objects that are actually visible need to be created. There is no way to do this efficiently with FTE at the present time.
    So we need a few new methods and classes that parallel what you already have.
    New Method 1)
    TextBlock.getTextLineInfo (width:Number, lineOffset:Number, fitSomething:Boolean)  : TextLineInfo
    This method returns simple information about all the lines in a text block. No display objects are generated.
    class TextLineInfo
        public var maxWidth:Number;   // maximum width of all the textlines in the textBlock
        public var totalHeight:Number;  // totalHeight of all the textlines in the textBlock
        public var numLines:int;           // number of lines in the lineInfo Array
        public var lineInfo:Array;           // array of LineInfo items for each textline
    class LineInfo // sample - more or less may be needed
        public var rawTextLength:int;
        public var textWidth:Number;
        public var textHeight:Number;
        public var ascent;
        public var descent;
        public var textBlockBeginIndex:int;
    Now getTextLineInfo needs to be as fast as possible. Find an advanced game programmer to optimize, write it in assembler, put grease on it.... do whatever it takes to make it fast.
    New Method 2)
    TextBlock.createTextLines (textLineInfo:TextLineInfo, begIdx:int, endIdx:int) : Array
    Creates and returns an Array of TextLine objects based on the previously created TextLineInfo. A range can be specified.
    It should be obvious that the above functions will improve the situation. Since this parallels what you already have it should not be earth shaking to implement.
    New Display Object type
    Much of the time you do not need a full blown Display Object Container for a TextLine. I suggest an additional lightweight TextLine class. A good parallel would be similiar to the difference between Sprite and Shape.
    Now I have some done some testing with this idea. Since you cannot implement this fully as it stands, I had to make some concessions. This sample contains 100,004 characters of data. You can resize it and it will always be fast. This sample only creates the visible portion of the display, but you may scroll into view the invisible portions. Each time the page is resized, it will jump back to the top, because of the limitations of FTE currently.
    The sample also contains a caret and allows the selection of an area but no editng, copy, paste  etc., is available for this test.
    If I did not do special handling for this, it would lock up for sure and be very user unfreindly.
    Now it takes a moment to load 100k into the TextElement.so there may be a pause before you see that data. I may need to improve this. Once loaded it performs quite well.
    Without the above or similiar optimizations. FTE is just not going to scale up very well at all.
    Don

    Jeff, I don't see how a fix for that bug means waiting for a major release. It seems it just does not work as you expected and perhaps documented. It should not break any code, should it ? This seems a somewhat major improvement.
    Using recreateTextLine in 10.1 I have these results so far:
    My test case is 668 lines and using my slow test machine so the timing can be picked up.
    When using just createTextLine and creating all text lines:
    ......Using removeChildAt to first remove all the old textLines then create all textLines:
    ..........it takes ~670ms
    ......Removing all children at once by removing the container then create all textLines:
    ..........it takes ~570ms
    Using recreateTextLine, getChildAt, then create all textLines:
    ..........it takes ~670ms
    So recreateTextLine does not improve performance it seems, just better memory I suppose.
    Don

  • Suggestions for visualizing the temporal or calendar based patterns in c#

    Hello Everybody,
    In my console application, I am searching for specific Patterns in existing database. If any pattern found , then it will write into seperate table with some Details.
    Now, I want to visualize those Patterns. Could someone suggest me ideas to visualize those Patterns in a meaningful way using c#?
    My table Looks like this. Relative monthly pattern could be the Operator was absent on every first monday of every month in a year.

    The easiest method is to make the dates BOLD.
                monthCalendar1.BoldedDates =
    new
    DateTime[] {
    DateTime.Parse("3/3/15"),
    DateTime.Parse("3/10/15"),
    DateTime.Parse("3/24/15")
    jdweng

  • A suggestion for all the people with panics and piix

    Everyone may overlook this because it seems so simple of a possible fix. So I will try to explain why it may help. It has worked for me, and several others. My laptop uses this chipset, and so it intermittantly panics for me if I don't use this. My information may not be 100% precise, but I will try to explain the best I know.
    Since linux started using udev, hardware detection is asynchronous now. This allows faster and more efficient detection, but can cause all sorts of problems depending on the quality of your motherboard, bios, and other gear. So depending on circumstances, the time it takes for udev to get responses from all hardwares might vary depending on any number of circumstances. Limitless changes in kernel, firmwares, bios, drivers, etc- everyone's experience might vary. It may have worked fine in 2.6.17, but 2.6.18 does not work at all, 2.6.19 is spotty, etc...
    This problem mostly occurs in my usb/external and sata drives. But in certain times I will get panic on my ide internal drive on boot. The bootloader relies on BIOS detection to get started. But once kernel loads, control is turned over to kernel. But kernel/udev request might not get response in time (since its asynchronous now) before boot tries to turn over to root=/dev/xxx. So mount fails, panic occurs. Earlymodules=piix tries to thwart this problem by loading the module much sooner. But again, depending on yout hardware, it might not happen soon enough. Also, since the drive will be busy at random times depending, it might need to finish up before it will respond to udev.
    In summary, the drive has not responded to udev/kernel before the bootloader finishes loading the kernel and tries to turn control over to the new root. earlymodules=piix works for some, not others. Especially now since pata over ide. If you have this problem, the fix very well might be as simple as this, especially if you have sata, scsi or usb drives: Add rootdelay=15 on kernel line in bootloader. For example:
    kernel /boot/vmlinuz26ck root=/dev/sda2 rootdelay=15
    15=15 seconds. Might not need this much, but 15 second delay should be ample time for most people. For me, i don't use the earlymodules=piix, and I use rootdelay=5, and every time is fine. This option tells the kernel to literally wait x seconds before trying to turn root=/dev/xxx over and continuing boot. during this pause, you might see misc. devices returning info to udev before continuing, including your drive.
    It really probably does seem to easy or simple to be true. But try it- it might work for you. I have seen more people say OMG IT WORKED!! versus people who say it didn't. Hope this helps some of you.

    JSA2,
    Whether you're pro-Creative or anti-Creative doesn't make a difference if you're going to personally insult people. I appreciate the sentiment of the post, but if you want to continue posting here you'll have to remain civil, or we will suspend your account.
    BostonDanglr,
    The same applies to you. Even if you feel personally insulted by a post, don't let it get to you. You say you haven't heard from us in 0 days, was your contact with us by e-mail? If so, post a thread on General and let me know, and I'll get someone to look into why you haven't had a reply. If you're referring to this forum, this is not a Support forum, so we don't guarantee a response. Please read the Announcement link for more information.
    Cat
    Message Edited by Catherina-CL on 02-08-2005 09:42 AM

  • Suggestion for configuring the Hard Drive

    I just replaced my windows 7 laptop with a macbook pro. (So I'm new) i like the versatility of being able to use parallels and use windows in "coherence mode" - and can keep apple apps available. I think i understand the basic concept and would assume i would parition the drive with boot camp so i can take full advantage of the system resources - memory, etc directly from windows or linux as compared to a virtual machine where i would pre-allocate space and ram and resources are mapped. I am correct? The reason I ask this is becuase I don't think i need to take the full advantage of the 4gb when i'm running Win 7 - i just use office products mostly. so would i just configure the macbook pro drive as 1 partition? and then configure parallels with the appropriate sizing? where should i store audio and itunes - in the mac of win image?

    Welcome to Apple Discussions!
    My question is if all you use MS Windows for is MS Office then why install Windows at all? Why don't you just get MS Office 2008 for Mac and live happily ever after?
    Regards,
    Roger

  • Suggestion for improving the iTunes Store

    I just wanted to put forward a suggestion.
    It would be really useful if when buying products off the iTunes Store you could tick a box to indicate whether. . .
    a) you have watched the films/podcasts and...
    b) whether you already own the product (much like the way you can do this with books on amazon)
    This way you could have it make suggestions not including things you already own. I am finding particularly with the film store, I am enjoying one film and all of the recommended ones I have already either seen or already own.

    You can send feedback/feature requests directly to Apple at this link: Apple Product Feedback

  • Any suggestions for keeping the magic trackpad from sliding around?

    When I push up with two fingers, the 'pad moves.  I usually just put an iPod touch in back of it (iPod has a rubber case, prevents sliding).  But a more practile solutions would be best (don't always have iPod around)
    I wish the little rubber pieces on the bottom of the trackpad were more grippy...

    I always thought those pads were "grippy".  What kind of surface do you have it on?
    Here's one suggestion though.  Get a thin piece of vinyl sheet a little larger than the trackpad.  That stuff sticks to most any smooth surface and will definitely grip the trackpad.  I know this because I use this stuff.  But almost anything equivalent will do.
    Note, I use not to keep the trackpad from slipping, but to keep it from scratching my acrylic desktop (also bought from the same place as the vinyl).

Maybe you are looking for