locked
Windows Mobile 6.5 device load C# app extremely slow RRS feed

  • Question

  • I am developing a Windows Mobile 6.5 device based on TI DM3730 EVM2 board and its official CE6.0 BSP. 

    Now Windows Mobile 6.5 system have already booted and everything works properly except C# app.

    It takes very long time to load a very simple application, which is normal under CE6.0 system on the same board.

    I have tested a simple application, which just show a empty form, it takes over 5 seconds to show the form.

    I only changed OAL code, all the device drivers are not even touched.

    I am not quite familiar with C#, could anyone give me any advices?

    Thanks.

    Monday, April 22, 2013 10:44 AM

All replies

  • I have done everything, I changed AKU, Modified pOEMIsProcessorFeaturePresent, changed memory configuration, disable VFP, remove frequency change policy, but nothing change. 

    I know maybe no one has ever seen this kind of problem, but still could any one at least give me any advises on what possibly could cause JIT so slow.

    Thanks.

    Wednesday, May 29, 2013 3:53 AM
  • What are all the code you have changed in OAL? Are you porting the BSP to your device? or this is happening in the EVM?

    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Wednesday, May 29, 2013 5:43 AM
  • Vinoth, thank you so much for your reply.

    TI only provide a CE6.0 BSP, What I did is change the OAL layer structure from CE6.0 to Windows Mobile.

    1. Remove the reference of pOemGlobal, which is defined in CE6.0, and change some OAL require function pointers and variable assignments.

    2. Change the PQOAL directory layout. 

    I have not change much code, I just adjust the structure about the code.

    For example:

    In CE6.0, there has code like this.

    g_pOemGlobal->pfnEnumExtensionDRAM = OEMEnumExtensionDRAM; 

    And in Mobile, I have to change this into:

    pNKEnumExtensionDRAM = OEMEnumExtensionDRAM;

    And  I did all this on TI's evaluation board. 

    Any idea or you need any other information?

    Best Regard!

    Wednesday, May 29, 2013 8:20 AM
  • What is the current Status of demand paging (Enabled or Disabled) in ROMFLAGS?


    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Wednesday, May 29, 2013 9:09 AM
  • Demand paging is enabled.

    ROMFLAGS=12

    Do you concerned about code pitching?

    Wednesday, May 29, 2013 9:17 AM
  • Should I disable it or what?

    If I disable demand paging, should I change anything else? I have not disable demand paging before.

    Thursday, May 30, 2013 8:07 AM
  • No need to disable it. i thought it is disabled.

    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Thursday, May 30, 2013 8:41 AM
  • So any more ideas?

    It's so great to have you discuss over this issue with me. Thanks.

    Thursday, May 30, 2013 8:58 AM
  • you can try with Debug build (OS binary) and watch the debug messages for which modules/DLL is taking time during launching the application.

    Also you can perform kernel tracker by enabling the CELOG option to know the time taken for the application ( which thread took more time and where are all the control goes etc..)


    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Thursday, May 30, 2013 9:49 AM
  • Hi, Vinorh.R:

    After half month following this problem, I found a strange thing about this problem. When there have some other interrupt happened while C# application is ongoing, the app load faster.

    For example, if I hold the touch pen on touch screen,  then it will only take 5 seconds to load calculator. 

    Could this be dead lock? The interrupt cause reschedule and other thread got chance to run and release some resources need by C# app, or something like that? 

    To ensure the interrupt did not do anything special, I write a timer interrupt service with hardware timer3, the interrupt thread only update timer counter and restart timer. This also could speed up C# app. And the shorter the timer period is, the faster the C# app runs. I really could not see the connection between these things. 

    Any idea up or any Guess?

    Thanks.

    Monday, June 17, 2013 6:48 AM
  • Did you run the Kernel tracker (or) CELOG? you can find the blocking resource with this during launching the application

    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Monday, June 17, 2013 8:31 AM
  • No, I did not, actually I did not know how to. I have never run this before. I will try it. Thanks.
    Monday, June 17, 2013 9:59 AM
  • I want to use CELOG, I have alread got celog.clg. When I tried to readlog, I got this error.

    E:\WM6533\PUBLIC\COMMON\SDK\SAMPLES\CELOG>readlog celog.clg celog.txt
    Error 2 opening celog.clg for input

    What is that?

    Monday, June 17, 2013 10:29 AM
  • if you have the celog.clg file, you can directly open it through remote kernel tracker.

    Before that if you want to know thread details, you can find it through readlog command that can be run in the Windows mobile build envirnonment (cmd prompt) in the release directory.

    readlog –fixthreads g:\celog.clg g: \outputlog.clg


    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Monday, June 17, 2013 11:00 AM
  • Now I can see the log, Thanks very march. Could you guide me to find out the blocking resources?

    I can see a lot of informations, I don't know what to do with it.

    And I set CeLogSetZones to 0xFFFFFFFF, there has too much info. What is the proper value for this?

    Can I have your EMAIL? Maybe you could have a look at this.

    Thanks

    Monday, June 17, 2013 11:22 AM
  • i can't share the email ID here. i can help you here. you can run CELOG whenever you need instead of from the beginning.

    First enable only IMGCELOGENABLE and disable the IMGAUTOFLUSH.

    Copy the following registry settings and customize your need

    [HKEY_LOCAL_MACHINE\System\CeLog]
    "ZoneCE"=dword:815263 ; This shows the type of messages that has to be log
    "Transport"="LocalFile"
    "FlushTimeout"=dword:7D0  ;2000 ms per flush
    "SavedFlushes"=dword:1    ;16 x 2000 ms = 32 seconds
    "FileName"="\\celog.clg" ;log file location. This can be any place like hard disk, mounted volume

    assign the CELOG.clg file path to a removable or shareable disk with PC or in persistent storage.

    Write your own application that should start the CELOG whenever it is needed as shown below

    int _tmain(int argc, TCHAR *argv[], TCHAR *envp[])
    {
        PROCESS_INFORMATION	ProcessInformation;
    	NKDbgPrintfW(L"\r\n\r\n*********CELOG Flush Sample app started********\r\n\r\n");
    	NKDbgPrintfW(L"Current Time : %d\r\n",GetTickCount());
    	Sleep(20000);
    	NKDbgPrintfW(L"After Sleep Current Time : %d\r\n",GetTickCount());
    	if(!CreateProcess( TEXT("\\Windows\\celogflush.exe"),NULL, NULL, NULL, FALSE, 0,NULL, NULL, NULL, &ProcessInformation))
    	{
    		RETAILMSG(1, (TEXT("Error In Creating the Process  = %d\r\n "),GetLastError()));
    	}
    	else
    		NKDbgPrintfW(L"CELOG Flush started\r\n");
    	return 0;
    
    }

    in this way you can get only small about of log. you can run the application before start your application and once you get the necessary log you can remove the storage media or power off the device and copy it to the PC in the next boot(assumed you are saved in a persistent storage).


    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Monday, June 17, 2013 2:33 PM
  • I dig into the log, I found after I open the C# app MSCALC, I got a lot of log info like this.

     0:00:52.087.094 : EventReset, hEvent=0x4CDB4EBE
     0:00:52.087.099 : EventCloseHandle, hEvent=0x4CDB4EBE
     0:00:52.087.135 : WaitForMultipleObjects, Timeout=INFINITE, WaitAll=0, NumObjects=64

    followed by 64 objects.

    The NumObjects are 64, What does that mean. 

    I noticed this because I did not got this kind of info in the log file I added timer3 to force reschedule. 

    And how can I analysis this log file. Or do you got a link could explain this?

    Thanks.

    And if it is possible, I could send the log file to you by email.

    My EMAIL is zxmen@126.com.

    Thanks.

    Tuesday, June 18, 2013 5:20 AM
  • how did you open the log file? are you opening the .clg file in text editor? you can open the .clg file in  Remote kernel tracker to view the file graphically.

    if you have the Windows CE 6.0 MCTS preparation kit you can see the chapter 4 - Debugging and Testing the systems to know more about CELOG and kernel tracker usages.

    you can search the following keys in google "windows embedded ce 6.0 mcts exam preparation kit" to get it.


    Vinoth.R

    www.e-consystems.com

    http://vinoth-vinothblog.blogspot.com

    Wednesday, June 19, 2013 5:34 AM
  • I have the same problem as you.

    Friday, December 6, 2013 6:25 AM
  • I have the same problem! Did you slove the problem?
    Friday, March 28, 2014 2:29 PM