Spiked CPU when viewing multiple streams one at a time then publishing

Hi all,
We're finding the Flash Player's CPU process 'ratchets' slightly higher each time a user views a new webcam stream one at a time in a WebcamSubscriber.
For example, I'm watching the stream for User A, then that stream is deleted and I then watch the stream for user B, then that stream is deleted and I watch the stream A, B, or C, and so on.  It seems to 'ratchet' higher by the same amount regardless of whether I've seen that particular user's stream before.
It's only a few percentage points of CPU usage each time, but in the aggregate it can get to 100% usage and crash the flash player quickly. 
Some details of our tests:
- We've managed to contain it so this only happens when the user is also publishing.
- If a user has been watching for a long time without publishing, then starts publishing, the CPU usage will suddenly spike as soon as they start publishing.  In our tests it spikes as much and more as if they had been publishing the entire time. 
- If the user starts publishing before they start watching, they're not affected by this spike. 
- If a user starts publishing but hasn't been watching the streams, the publishing CPU usage is normal. 
- Refreshing the browser page and publishing again, CPU usage is normal. 
- Calling System.gc(); while running in the flash player debugger seems to have no effect on the CPU spikes.  Whatever streams are being kept around must still have something pointing to them so they won't be garbage collected. 
To subscribe to each successive stream, we're doing that by setting
webcamSubscriber.publisherIDs = [ newStreamID ];
We've been experimenting for a long time with different settings that might reduce the CPU spikes and ratcheting, but haven't been able to resolve the issue.
How can we prevent this CPU ratcheting and spking?
Thanks very much,
-Trace

Is it possible that you have other components that are interfering or spiking your CPU. Also if possible can you share your code.
Would you be able to check this link and see it hogs your CPU for more subscribers. - http://blogs.adobe.com/arunpon/files/2011/05/WebCameraFinal31.swf
Code for the app in the link
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:rtc="http://ns.adobe.com/rtc">
     <mx:Script>
          <![CDATA[
               import com.adobe.coreUI.controls.CameraUserBar;
               import com.adobe.rtc.collaboration.WebcamSubscriber;
               import com.adobe.rtc.events.CollectionNodeEvent;
               import com.adobe.rtc.events.SessionEvent;
               import com.adobe.rtc.events.SharedPropertyEvent;
               import com.adobe.rtc.events.StreamEvent;
               import com.adobe.rtc.events.UserEvent;
               import com.adobe.rtc.messaging.UserRoles;
               import com.adobe.rtc.sharedManagers.StreamManager;
               import com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor;
               import com.adobe.rtc.sharedModel.SharedProperty;
               protected var _camSubscribers:Object;
               protected var _currentSubscriber:WebcamSubscriber ;
               protected var _sharedProperty:SharedProperty ;
                *  Handler for the stop and start buttons.
               protected function startBtn_clickHandler(event:MouseEvent):void
                    if ( startBtn.label == "Start" ) {
                         webCamPub.publish();
                         startBtn.label = "Stop" ;
                         if (_camSubscribers && _camSubscribers[cSession.userManager.myUserID]) {
                              var webcamSubscriber:WebcamSubscriber = _camSubscribers[cSession.userManager.myUserID];
                              smallSubscriberContainer.addChild(webcamSubscriber);
                    }else if (startBtn.label == "Stop" ){
                         webCamPub.stop();
                         startBtn.label = "Start" ;
                * SynchronizationChange event handler. Initialize the Shared property used to sync the Subscriber info
                * who would be the centre of the app.
               protected function cSession_synchronizationChangeHandler(event:Event):void
                    if (cSession.isSynchronized) {
                         _sharedProperty = new SharedProperty();
                         _sharedProperty.isSessionDependent = true ;
                         _sharedProperty.sharedID = "webcamShare2" ;
                         _sharedProperty.connectSession = cSession ;
                         _sharedProperty.subscribe();
                         _sharedProperty.addEventListener(SharedPropertyEvent.CHANGE,onChange);
                         _camSubscribers = new Object();
                         cSession.streamManager.addEventListener(StreamEvent.STREAM_RECEIVE,onStreamRecieved);
                         cSession.streamManager.addEventListener(StreamEvent.STREAM_DELETE,onStreamDelete);
                         addExistingStreamers();
                *  Set up a thumbnail subscriber for every new camera stream
               protected function onStreamRecieved(p_evt:StreamEvent):void
                    if (p_evt.streamDescriptor.type == StreamManager.CAMERA_STREAM) {
                         setUpfromDescriptor(p_evt.streamDescriptor);
                * Clicking a subscriber updates the shared value, which in turn enlarges the thumbnail after getting updated
               protected function onClick(p_evt:MouseEvent):void
                    if ( (p_evt.currentTarget is WebcamSubscriber) &&  !(p_evt.target.parent is CameraUserBar)) {
                         _sharedProperty.value = (p_evt.currentTarget as WebcamSubscriber).publisherIDs;
                * Clean up when a user stops publishing his camera or exits his app.
               protected function onStreamDelete(p_evt:StreamEvent):void
                    if (p_evt.streamDescriptor.type == StreamManager.CAMERA_STREAM) {
                         if ( _camSubscribers[p_evt.streamDescriptor.streamPublisherID]) {
                              var webcamSubscriber:WebcamSubscriber = _camSubscribers[p_evt.streamDescriptor.streamPublisherID];
                              if (webcamSubscriber) {
                                   smallSubscriberContainer.removeChild(webcamSubscriber);    
                              if (p_evt.streamDescriptor.streamPublisherID != cSession.userManager.myUserID) {
                                   webcamSubscriber.removeEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
                                   webcamSubscriber.removeEventListener(UserEvent.USER_BOOTED,onUserBooted);
                                   delete _camSubscribers[p_evt.streamDescriptor.streamPublisherID];
                                   webcamSubscriber.close();
                                   webcamSubscriber = null;
                              } else {
                                   if (_currentSubscriber && _currentSubscriber.publisherIDs[0] == cSession.userManager.myUserID) {
                                        _sharedProperty.value = null;
                * Logic for handling the Pause event on CameraUserBar on every Subscriber
               protected function onCameraPause(p_evt:UserEvent):void
                    var userStreams:Array = cSession.streamManager.getStreamsForPublisher(p_evt.userDescriptor.userID,StreamManager.CAMERA_STREAM);
                    if (userStreams.length == 0) {
                         trace("onCameraPause: no userStreams");
                         return;
                    for (var i:int = 0; i< userStreams.length ; i++ ) {
                         if (userStreams[i].type == StreamManager.CAMERA_STREAM ) {
                              break;
                    var streamDescriptor:StreamDescriptor = userStreams[i];
                    if ( streamDescriptor.streamPublisherID == cSession.userManager.myUserID ) {
                         cSession.streamManager.pauseStream(StreamManager.CAMERA_STREAM,!streamDescriptor.pause,streamDescriptor.streamPublisherID);
                * Initial set up of all users who are streaming when this app launches
               protected function addExistingStreamers():void
                    var streamDescritpors:Object = cSession.streamManager.getStreamsOfType(StreamManager.CAMERA_STREAM);
                    for (var i:String in streamDescritpors) {
                         setUpfromDescriptor(streamDescritpors[i]);
                * Helper method to create a thumbnail subscriber.
               protected function setUpfromDescriptor(p_descriptor:StreamDescriptor):void
                    if (! _camSubscribers[p_descriptor.streamPublisherID]) {
                         var webCamSubscriber:WebcamSubscriber = new WebcamSubscriber();
                         webCamSubscriber.connectSession = cSession ;
                         webCamSubscriber.addEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
                         webCamSubscriber.addEventListener(UserEvent.USER_BOOTED,onUserBooted);
                         webCamSubscriber.webcamPublisher = webCamPub;
                         webCamSubscriber.subscribe();
                         webCamSubscriber.sharedID = p_descriptor.streamPublisherID;
                         webCamSubscriber.publisherIDs = [p_descriptor.streamPublisherID];
                         webCamSubscriber.height = webCamSubscriber.width = 180;
                         webCamSubscriber.addEventListener(MouseEvent.CLICK, onClick);
                         smallSubscriberContainer.addChild(webCamSubscriber);
                         _camSubscribers[p_descriptor.streamPublisherID] = webCamSubscriber;
                * This method is the listener to SharedPropertyEvent.CHANGE event. It updates the centred subscribes as its value
                * changes.
               protected function onChange(p_evt:SharedPropertyEvent):void
                    if ( _currentSubscriber != null ) {
                         _currentSubscriber.removeEventListener(UserEvent.USER_BOOTED,onUserBooted);
                         _currentSubscriber.removeEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
                         centeredSubscriber.removeChild(_currentSubscriber);
                         _currentSubscriber.close();
                         _currentSubscriber = null ;
                    if ( _sharedProperty.value == null || _sharedProperty.value.length == 0 ) {
                         return ;
                    _currentSubscriber = new WebcamSubscriber();
                    _currentSubscriber.connectSession = cSession ;
                    _currentSubscriber.subscribe();
                    _currentSubscriber.webcamPublisher = webCamPub ;
                    _currentSubscriber.publisherIDs = _sharedProperty.value ;
                    _currentSubscriber.addEventListener(UserEvent.USER_BOOTED,onUserBooted);
                    _currentSubscriber.addEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
                    _currentSubscriber.width = _currentSubscriber.height = 500;
                    centeredSubscriber.addChild(_currentSubscriber);
                * Logic for handling the Close event on CameraUserBar on every Subscriber
               protected function onUserBooted(p_evt:UserEvent=null):void
                    var tmpFlag:Boolean = false;
                    if (_currentSubscriber && _currentSubscriber.publisherIDs[0] == p_evt.userDescriptor.userID) {
                         if (_currentSubscriber.parent) {
                              _currentSubscriber.removeEventListener(UserEvent.USER_BOOTED,onUserBooted);
                              _currentSubscriber.removeEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
                              _currentSubscriber.close();
                              _currentSubscriber.parent.removeChild(_currentSubscriber);
                              _currentSubscriber = null;
                              _sharedProperty.value = null;
                         tmpFlag = true;
                    if ( _camSubscribers[p_evt.userDescriptor.userID]) {
                         var webcamSubscriber:WebcamSubscriber = _camSubscribers[p_evt.userDescriptor.userID];
                         tmpFlag = true;
                    if (tmpFlag) {
                         webCamPub.stop();
                         startBtn.label = "Start";
          ]]>
     </mx:Script>
     <!--
     You would likely use external authentication here for a deployed application;
     you would certainly not hard code Adobe IDs here.
     -->
     <rtc:AdobeHSAuthenticator
          id="auth"
          userName="Your Username"
          password="Your password" />
     <rtc:ConnectSessionContainer id="cSession" authenticator="{auth}" width="100%" height="100%" roomURL="Your RoomUrl">
          <mx:VBox id="rootContainer" width="100%" height="800" horizontalAlign="center">
               <rtc:WebcamPublisher width="1" height="1" id="webCamPub"/>
               <mx:VBox width="500" height="500" id="centeredSubscriber" horizontalAlign="center" verticalAlign="middle"/>
               <mx:Label text="Click on a Subscriber thumbnail to make it bigger." />
               <mx:HBox width="100%" height="200" horizontalAlign="center" verticalAlign="top" id="smallSubscriberContainer" creationComplete="cSession_synchronizationChangeHandler(event)"/>
               <mx:Button  id="startBtn" label="Start"  click="startBtn_clickHandler(event)" height="20"/>
          </mx:VBox>
     </rtc:ConnectSessionContainer>
</mx:Application>
Thanks
Arun

Similar Messages

  • Uploading multiple items one at a time - file view resets

    In my work, I need to upload many files, one at a time, using an interface through the browser.
    When I go to upload multiple files, one at a time, using 10.6.2, the Finder takes me back one or two levels down from the file location between uploads. In 10.4, the Finder always took me back to the folder last accessed.
    Is there a Preference, Shareware like TinkerTool, or a Terminal Command I can use so that I always go back to the folder last accessed?

    OK. Wow. I did not realize the question was so obtuse. Feel free to ask for clarification (no reason to be nasty or flame me).
    "what mechanism is being used"
    In my original post, I did say I was uploading via a browser. So I don't know if this clarifies for you or not.
    Using Firefox or Safari.
    Uploading photos, one at a time, to a website that uses the browser (rather than FTP).
    In OS 10.4.11, after each photo, I would upload a second one and the dialog box would open up to the same folder as the previous upload, greatly simplifying the process.
    In OS 10.6.3, after each photo, I would go to upload a second photo and the dialog box would open one level down, or sometimes seemingly randomly, two levels down. This requires me to navigate back to the folder with the photos which greatly increases the amount of time between each upload.
    It would be helpful if I could show photos to explain.
    I am not certain that this really clarifies my original posting. Does this make sense or do you need more info?

  • When viewing multiple item information, I was wondering what the checkboxes next to "Artist", "Album Artist", etc... are used for.

    When viewing multiple item information, I was wondering what the checkboxes next to "Artist", "Album Artist", etc... are used for.

    When checked, it means that you are going to apply whatever is in the box to all of the selected items.

  • For some reason, I can not delete bookmarks. I did one at a time, then tried 5 or 6 and it worked once then no more. I then tried 1 at a time and it worked once the no more. This is a brand new computer (Win7) and FF just loaded about 3 hours ago.

    # Question
    For some reason, I can not delete bookmarks. I did one at a time, then tried 5 or 6 and it worked once then no more. I then tried 1 at a time and it worked once the no more. Why is this happening? This is a brand new computer (Win7) and FF just loaded about 3 hours ago. Do not know how the bookmarks even got in there. Some were ok, but no order and some that were never bookmarks. Looks like FF tried to import some BM's from the Virtual XP installed, but did not get it any where near right. I need to completely delete all of them and install from a saved .html file.

    Well, I did not see the exact problem that I was having listed in the articles, BUT the problem is solved for now.
    I opened FF and the Bookmarks to Organize again. I deleted all of the folders and entries, ONE AT A TIME, AND IT WORKED. Evidently, for what ever reason, FF did not like "Batch" deletes of ANY amount greater than 1 and the HANG UP would occur.
    Deleting one at a time then importing the good .html from a good file, loaded the wanted Bookmarks. Yea

  • Hi, Like in our laptop when we press a key for a time then that alphabet's frequency continue to increase.

    Hi,
    Like in our laptop when we press a key for a time then that alphabet's frequency continue to increase.
    for eg. if we press "j" in text then it will be like "jjjjjjjjjjjjj" on screen.
    that function in my macbook pro disabled.
    Please help me with this cause its very irritating.
    Thank You
    <Edited by Host>

    I think it's a keyboard malfunction. Take it to Genius Bar or authorised service centre to fix it up.

  • Can I view multiple sheets at the same time?

    My search fu hasn't been up to finding how, or if it is possible, to view multiple sheets of the same document at the same time. Can it be done? Either a split view in a single window or multiple windows would be fine.

    marchyman wrote:
    Thanks for the answer. Another workaround is to copy the table that I'm interested in and move it to the sheet where I want to see it. When done I can copy it back or delete it. Just seems like extra effort for something that should be built in.
    No need to copy the sheet. You could just drag it to the sheet where you want to see it, and when done, drag it back 'home'. (This can be done using the icons in the sidebar.)
    Caution: Changing to this method will require vigilance on your part to prevent accidently deleting the table instead of moving it. frequent Saves are recommended.
    Regards,
    Barry

  • Cant view photos except one at a time??, and other iphoto weirdness, help!

    My iphoto is crazy, it does weird stuff all the time. A few months ago it started randomly eating pictures and a grey block would show up where they used to be. Just recently when I open an event i I can only look at the pics one at a time, not like smaller pictures in rows, where you can select them and do stuff with them. I don't know why it is different!!! I would think I could just change something under view and fix it, but nothing seems to help. Please someone help!

    Welcome to the Apple Discussions.
    Just recently when I open an event i I can only look at the pics one at a time, not like smaller pictures in rows,
    There's a slider lower right of the iPhoto Window - drag it left.
    A few months ago it started randomly eating pictures and a grey block would show up where they used to be.
    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library (Right Click -> Show Package Contents) allowing it to overwrite the damaged file.
    2. Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new *iPhoto 08* library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.
    Regards
    TD

  • Flash player will stop playing after a while, when viewing certain streams in fullscreen mode.

    Hey, can you help me with this problem?
    When I start vieweing certain video streams, such as this one http://www.animefreak.tv/watch/hentai-ouji-warawanai-neko-episode-1-online the player would play for a while, then suddenly lose sound, and after 5 seconds or so, it will stop playing.
    If I click for pause, then play again it will work for a while, but it's very annoying and there's not much I can do about it.
    I have the same problem on 2 computers, with 2 different OS's (windows 7 & 8).

    I suspect you are running into the bug that is described here:
    Flash Player 11.7 Sound Playback Bug

  • Rendering problem when viewing more than one document

    Hi
    I have a weird problem. When I open two or more documents the rendering of the pages gets extremely bad for all documents except the first one, which remains just fine. What to do?
    BR
    Christian

    Hi
    I have a weird problem. When I open two or more documents the rendering of the pages gets extremely bad for all documents except the first one, which remains just fine. What to do?
    BR
    Christian

  • No video when viewing podcast stream page made with iWeb08

    I created a podcast project yesterday with iWeb08. Used compressor 3 ipod 420 preset to enode a .m4v. It plays fine on a Mac but PC users only hear the audio when going to podcast streaming site made with iWeb08.
    These are some language lessons that I need to get running today:
    http://www.olc.edu/~bchargingcloud/Lak-language/Podcast/Podcast.html
    thank you

    I took a look at your site on a Windows machine, in Internet Explorer - it DOES play the video, but only if QuickTime version 7 is installed. I.E. is not currently designed to alert viewers that they need the QT-7 plug-in - so you may need to add that information to your site.
    Anybody with an iPod or iPhone will already have QT-7 installed on their Windows machine.
    Fascinating project, by the way! Congratulations!

  • WRT54G ver 6. Buffering problems when viewing live streaming Video!

    Whenever my computer is connected to the computer through linksys WRT54G router, Windows Media Player do a lot of buffering. (after every 10 seconds or so). But when I connect to the internet directly through the cable modem, I don't see any buffering and I can watch the video without any problem.
    Any advice!

    I've tried most suggestions with no luck.  I've got a WRT54G v6 router with the 1.01.1 updated firmware.  Videos from MSNBC, CNN, CBS, etc... just don't want to run smoothly- and this is on a wired connection to the router.  All 3 computers hooked to router have this problem.  Choppy video or the video stops and the audio continues- or than everything pauses.  I have decent connect speeds- avg test is:
     9.66Mbps or 1.20MBytes/sec... I switched back to my old Linksys wired router and the videos played fine-connections speeds were consistent as well.  I use the wireless access for a Wii. All computers are wired into the router.  I am figuring it MUST be the router since my old router makes the problem go away...but I need the wireless access on the WRT54G for my Wii.  I did not notice if this problem was there before I upgraded the firmware since I did the upgrade when I installed the new router.  Thanks for any advice.
    RandyB

  • IS there a way to load and purchase different photos from iPhoto and ship them at the same time? the only way that I can find is to purchase each photo (or multiple of one) at a time, which increases the cost of shipping, as I want to get one print of 20

    Is there a way to order multiple different prints in any quantity from Iphoto? it appears currently like I would have to ship each separately, even if only one print... is there a way around this so I can can get several DIFFERENT prints of any quantity and ship all at the same time?

    Sure - easiest way is to make an album for photos you want to order and drag photos to it - when it is complete open the album, select all and order
    LN

  • Multiple MPEG one at a time

    I have a small business where I have multiple mpegs that I play in a different order at different shows. When I use Quicktime and select several movies it play them all at one in different windows. I change the setting to open a different window out.
    Is it possible to select 10 mpegs and make them play one after the other in Quicktime. I want it to be like a playlist in iTunes.
    Thanks!
    Denald

    You can use MPEG Streamclip and join them all together so you have one long movie. Use batch list mode, it has two options - one to fix timecode errors ( do always) and join together ( do in this case).
    There are several QT players like NicePlayer or XinePlayer that have playlists.

  • Viewing multiple clips in 1 window/ viewing a playlist

    Is it possible to view a playlist / several clips in one window (like windows media player playlist) with a mac? Either with quicktime or another viewer?
    as when you want to view several clips and move back and forth - you can't - you have to open one at a time - then expand them one at a time.
    Cheers

    Xine Player is also rather nice. MPlayer OSX was a good playlist player but it seems to have gone to pot in Tiger.
    Note if you set QT to open new clips in a new windows and you don't overdo it with 20 clips at once (depends on your CPU and RAM really) you can have multiple instances of QT playing and click to make one active while the others play on or pause.

  • How do I view more than one playlist at a time in iTunes 11?

    I cannot figure out how to view multiple playlists at the same time, in iTunes 11 (mac version). Previously, I could just double-click on the playlist name, and it would create its own window. Then I could compare or move songs between different playlists.

    I found it amusing that many of the questions can be answered with "impossible" when it comes to iTunes 11.
    and yours as well I am afraid.

Maybe you are looking for