Management API : memory pools question

Hie,
I have big issues when trying to find out the actual cycle of life of an object in memory pools. Does anybody have documentation about it ?
What I kinda understood is :
1. instantiation of a class : the object goes directly in the Eden Space mem pool
2. a first run of gc processes this object (this first run of gc() is quite immediate after instanciation) :
* object is still visible : gc() puts it in the Tenured Gen pool (? or in survivor space???)
* object is not : there it's quite obscure, gc() randomly collects it...
What I want to measure is the actual peak of memory heap (that is objects that are still visible and non-collectable).
So far, i uses getPeakUsage() of the tenured gen pool, which seems to be quite correct...
so here are my questions :
* how often do gc() run on each memory pool ?
* how do gc decide whether an object goes in 'survivor space' or in 'tenured gen'
Thanks !

1) There are two types of collecion:
minor (newgen only)
major (full)
minor collection are rather frequently and fast, major are time consuming and rare. GC tries to adaptively set size of newgen to optimize overhead.
use -XX:+PrintGCDetails switch
2) This mostly based on object age (how much minor collection it has before, after number of collection passed object considered long-living and been promoted to tured gen) and size (big object can be allocated in tenured).

Similar Messages

  • Java 5 management API : memory pools

    Hie,
    I have big issues when trying to find out the actual cycle of life of an object in memory pools. Does anybody have documentation about it ?
    What I kinda understood is :
    1. instantiation of a class : the object goes directly in the Eden Space mem pool
    2. a first run of gc processes this object (this first run of gc() is quite immediate after instanciation) :
    * object is still visible : gc() puts it in the Tenured Gen pool (? or in survivor space???)
    * object is not : there it's quite obscure, gc() randomly collects it...
    What I want to measure is the actual peak of memory heap (that is objects that are still visible and non-collectable).
    So far, i uses getPeakUsage() of the tenured gen pool, which seems to be quite correct...
    so here are my questions :
    * how often do gc() run on each memory pool ?
    * how do gc decide whether an object goes in 'survivor space' or in 'tenured gen'
    Thanks !

    1) There are two types of collecion:
    minor (newgen only)
    major (full)
    minor collection are rather frequently and fast, major are time consuming and rare. GC tries to adaptively set size of newgen to optimize overhead.
    use -XX:+PrintGCDetails switch
    2) This mostly based on object age (how much minor collection it has before, after number of collection passed object considered long-living and been promoted to tured gen) and size (big object can be allocated in tenured).

  • Custom memory pool.

    Hi!
    I have been studying different ways to implement object cache for server application(s). At the server there are XML files which have to be parsed and validated before delivering to clients. Clients are also sending XML data back to be validated and stored by the server. It would be nice to have object cache between servlets and IO to make server run faster. The ultimate requirement for cache is: There have to be way to set upper limit for caches memory footprint to avoid OutOfMemory.
    I found couple of third parties object caches like Java Caching System (JCS), OSCache, Commons Collections, JCache API but none is supporting cache policy to fulfil my requirement. Am I right? Is there any others? (Open Source)
    I started also desining my own implementation of object cache but the problem is: How to calculate object size in bytes.
    I tried to solve problem by creating interface Cacheable that contains method sizeOf(). It is quite easy to implement and calculate approx size of (simple data) object except String. I wrote my on custom String class to get size. I also wrote some Cacheable implementations of collection classes too. But next problem was that (object) cache become too specific.
    Okey, now JMX questions : )
    1. Question is: Is it possible to use JMX to create totally new memory pools within same VM for object cache. Why? It would be easy to examine memory usage of cache by examining memory usage of those pools.
    2. Is there way to set a classloader to load certain classes to those memory pools.
    3. Is it possible to set a "rule" that instances of those classes are placed also into new pools.
    4. Does JMX inspection have some severe performance drawbacks?
    Plan B
    I have also considered idea of running object cache as independent service in its own VM. And connecting to it by RMI. Any comments? Performance issues? Have anybody done this?
    Thanks!

    I do not think it is possible for user code to create a new memory pool in the sense of the ones that show up in JConsole's Memory tab ("PS Eden Space", "PS Perm Gen", and so on.)
    I would in any case advise against getting into the details of object sizes. The question is very difficult - for example, is the size of an object the total size of all objects reachable from it? If so then if x and y are two objects that have part of their object graph in common, adding the sizes you compute for x and y will produce a size that is too big. If you want to get involved in this anyway, a good starting point is <http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html>.
    You can in fact get a number representing the size of a Java object by writing a premain method and then using Instrumentation.getObjectSize. See java.lang.instrument. But this size does not include objects referenced from the given object, so it does not really tell you how much memory the object is taking up. For example, all String objects will show the same size, because the char[] containing the actual contents of the String is another object that is referenced by the String.
    The usual way to handle object caching is with SoftReference, see java.lang.ref. Admittedly, this does not give you an easy way to balance the sizes of different pools.

  • EWS Managed API - 1. BindToItems returns ErrorAccessDenied error, 2. appointments created in one mailbox show up in others

    Hi,
    I know there are other questions about ErrorAccessDenied but they are not exactly describing my situation and all are pretty much old and mostly not answered so forgive me for creating my own.
    Also, wall of text coming so please bear with me.
    We have an application that synchronizes Exchange items into our internal systems. Items created on Exchange are stored in that system and vice versa of course with a lot of business logic and rules, etc. Application uses EWS Managed API and impersonation
    to access users mailboxes. Everything works fine but now we have this one customer that has a lot of strange things going on with main 2 problems mentioned in subject.
    1. To ensure both sides (Exchange and our system) are in sync we have a functionality that allows users to decide that items no longer existing on Exchange should be removed also from system database. Since in our record we store id of original Exchange
    item internal system simply sends us list of those ids to confirm items still exist. What application does is a BindToItems method call with BasePropertySet.IdOnly as requested property and depending on server response we notify internal system about state
    of items. There is some semi complex logic behind what exactly is done on system side but in general NoError and item returned means item exists, ErrorItemNotFound means item doesn't exist.
    For this one customer suddenly we started to receive ErrorAccessDenied and ErrorBatchProcessingStopped error codes which is very strange because seconds earlier there were events read from PullSubscribtion, items read from server, items created on server
    and bunch of other stuff going on which basically makes me sure that impersonation is working. For some reason during execution of this particular code ErrorAccesDenied is returned and it messes up whole BindToItems call.
    But what is really strange is that for first id in list of ids we get NoError and correct item returned, for second id we get ErrorAccessDenied, and rest of responses is ErrorBatchProcessingStopped. So is it really about credentials or there is some
    completely different reason AccessDenied is retuned? According to customer those items exist in user mailbox for whom those errors are showing up. It doesn't happen for all users, only for some - who have exactly the same configuration of mailboxes as rest
    (according to customer).
    2. For same customer another problem started to occur since 1st of January, at least that is a date when they noticed it for the first time. Again, it happens for some users and there is no scenario that would guarantee to reproduce it.
    When new record is created in our system or its data change it has to be created/updated on Exchange. With same impersonation as for problem described above I simply create new item or find existing item using id provided by our system, set item properties
    according to whatever was sent and save/update item on Exchange. Simple and it works in multiple installations without problems.
    But this customer reports that appointments created for one user show up in other users mailboxes which I find really strange because as far as I know when I impersonate [email protected] everything I do is executed in context of this one user only. So if
    I create appointment in his calendar I cannot create same appointment in userB's calendar without explicitly switching impersonation to userB. What is worth mentioning during our sync process we store on Exchange items bunch of custom properties that help
    us verify whole process and do various filters, etc. All of those custom properties are visible in outlook in that design form view or whatever it is called. And I have screenshot from user that claims to have one of those "not his" appointments
    and basically half of our properties is not there and some have no values while they definitely should have otherwise whole sync would fail and everything is logged as successful.
    Sorry for this wall of text but I really have no idea what can causing those strange problems so I tried to describe as much as possible without breaching NDA and such stuff. We added a lot of logging around areas where impersonation is changed, Exchange
    items are created/updated, etc. Logs show nothing, of course.
    So, for first issue: is it possible that items were moved on Exchange in such way that user still can see them but for EWS API call we get ErrorAccessDenied? I'm not sure where exactly could be such location because if id of an item would change we should
    rather get ErrorItemNotFound or even something about id being not properly formatted, right?
    For second issue: is it possible that there is something running on Exchange server and does some kind of simplistic mirroring of items between mailboxes? Customer claims there are no such things on server nor user side but can it be something that non-IT
    people wouldn't know? Like some kind of script that admins like to run to keep server healthy or something innocent but lethal for our scenarios? Anybody has any hints what we should even ask customer about to get closer to solution of those mysterious problems?

    Were you able to figure what was going on with your first problem? we're seeing the exact same issue with one of our customers.

  • How to get list of Users[MailBoxes] in Exchange Server 2013 by using EWS Managed API

    Hi all,
    I need list of Users exists in my Exchange server 2013 , i.e Mail Box Users login name.
    I was  created Full Access permissions of all users to Admin user account,  to access each user Mailbox programatically 
    i need the list of Mailboxes in exchange server .
    MailBox  mailbox = new MailBox("user");
    Please share your ideas

    Hi,
    We can run the following command in Exchange Management Shell to get all user mailboxes name and export it to a .csv file:
    Get-Mailbox -ResultSize Unlimited | Select Name,Alias,RecipientTypeDetails | Export-Csv c:\Users.csv
    If you want to retrieve the list of users by using EWS Managed API, I suggest you can ask a question in Exchange Development forum for more suggestion:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
    Regards,
    Winnie Liang
    TechNet Community Support

  • Use of Lync Icon in custom UI's built from Lync 2013 Managed API

    We are a Microsoft Gold Partner with Application Developers status.  I am building an application using the Lync 2013 managed API to evoke Lync 2013 client commands from a tab within my application. How can I use the Microsoft Lync 2013 icon on the
    tab which opens the custom UI to display Lync 2013 client function buttons since this sends the managed API commands to the Lync 2013 client.  
    Who can help me with understanding the use of Microsoft icons within Microsoft provided managed API's and SDK's used to develop applications ?
    Also can I redistribute the Microsoft Lync 2013 client within the application as a redistributable?
    AG

    Hi,
    The issue is more related to Lync development. You may post a question on MSDN forum and more Lync development expert will help you. Thank you for your understanding.
    http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/threads
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Crystal Reports version 13 managed api's run slower than native version 11

    Hello,
    I am a senior engineer, working in a project of porting client code written in C++ using Crystal 11. It uses the native COM api like shown approximately in the following code fragment:-
    IApplicationPtr pApplication;
    pApplication.CreateInstance("CrystalRuntime.Application.11");
    pReport = pApplication->OpenReport("myreportfile.rpt", vtOpenMethod);
    ... code to setup Export Options, setLogonInfo on database, set parameters for report etc.
    pReport->Export(false);
    This code is launched in few threads, and works nicely, and a very stable used code in real world.
    We have ported this to Crystal 13 .NET api's and our code approximately looks like
    ReportDocument document = new ReportDocument();
    document.Load("myreportfile.rpt", OpenReportByTempCopy);
    .. set diskfile format options, pdf format options, paramters, logon info etc. very very similar to the native C++ code, almost matching 1 by 1 line
    document.Export();
    document.Close();
    No problem so far, and it works fine. This is also launched in multiple threads same in number like native, and works fine. We get the same pdf file generated.
    But here is the problem. In native we are getting easily around 2000 reports in 20 mins. But in managed we are taking 35 mins for the same set of reports. The output looks fine and same etc. But there is a good 40-50% performance regression, and we have tried so many things, but never able to beat this 40-50% perf degradation.
    Can you please help ? A few questions. First are we executing document.Export really concurrently ? Is there any waiting or serialization going on insider Crystal api's. Is this Crystal 13 managed api, a thin stub layer just passing on to native COM apartment threaded dll. Can this layer introduce such a delay ?
    A few things we have tried and haven't succeeded for summary:-
    1. Opened 1 dummy report in the beginning and kept opened throught, to flush any ref counted inits
    2. Didn't perform Close immediately, but had another thread chew on it and Close delayed
    3. Reduced the thread to 1, (in native as well), again our perf degradation is comparable.
    4. Optimized the reports from various suggestion in this forum. Did better, but so did the native, and still we are comparatively poorer.
    Thanks for the same, Eager to supply more info if required.
    R. Sridharan

    First I'd like you to have a look at the document SAP Crystal Reports Engine in a Multi-Threaded Visual Studio Application. Next make sure you are using SP 10 for CRVS.
    Next, you will have to tell me what database you are using, connection type and if MS SQL, what client?
    BTW.; these being community forums, you may get an answer, you may not. It may be timely, or not. If you are looking for a faster response, there is the option of creating a phone incident here:
    Crystal Single Case Technical Support - SAP Business Objects US Online Store | SAP Online Store
    One more KBA to look at:
    1403341 - How to export reports in multiple threads using the Crystal Reports .NET RAS SDK 
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter
    Message was edited by: Ludek Uher

  • Command line interface to "code cache" memory pool utilization

    I need to monitor the usage of the "code cache" memory pool through a command-line interface, but it doesn't seem to me that the jstat tool is able to give me any information about this particular memory pool. Are there any other tools that is able to give me the details I need? I'm using both JDK 5 and 6.
    Edited by: normann1974 on Jul 10, 2008 9:40 AM

    Typically, this is a class path Problem when the JVM is unable to locate a
    class. Are you sure that the class listed as missing below is included in
    your class path?
    Michael Girdley, BEA Systems Inc
    Learning WebLogic? Buy the book.
    http://www.learnweblogic.com/
    "Pascal Guillot" <[email protected]> wrote in message
    news:3a5df1ee$[email protected]..
    >
    I seem to be running into dificulties when attempting to use theweblogic.Admin class for any commands from the command line
    I am running from a Solaris 5.7 box, and java version 1.1.6, and weblogic6.0 server is running in the background
    Anytime I attempt to run the class:
    java weblogic.Admin <commandofsort> (followed by any neccessary args) Iget the following error msg:
    >
    java.lang.NoClassDefFoundError: javax/management/AttributeList
    at weblogic.management.commandline.CommandLineArgs.<init>(CompiledCode)
    at weblogic.Admin.main(Compiled Code)
    (I can successfuly invoke most of the utililities in the utils classhowever)
    >
    any ideas?
    Pascal

  • Work Manager API in Sun Java Application Server 8.1

    I am trying to build a parallel application using Work Manager api (javax.resource.spi.work.WorkManager;)
    I studied the Websphere implementation of WorkManager there you need to make JNDI lookup for work manager and then use it to submit the work.
    My question is if i make class which will implement the javax.resource.spi.work.WorkManager; interface and use that class to submit the work and execute it in parallel then will that class will handle the resource management and all j2ee services
    Do we have separate implementation of work manager API for Sun Java Application Server 8.1 (any jar like asynch.jar in IBM websphere) so that we will just create a work manager using admin console and make JNDI lookup and use it
    Please guide me

    Before I start, disclaimer -- I have no knowledge of Hibernate and the following comments are based on the stack trace you have included.
    I think your permissions might be set all right but you might have an error in the hibernate query. It looks like hibernate uses antlr to parse the queries. While parsing the query, antlr is encountering an exceptional condition and is trying to exit the VM (by calling System.exit()). Obviously, the hibernate code does not have that permission and therefore the exception is logged.
    My guess is if you fix the query such that hibernate/antlr can parse it, you will not run into this error.
    Hope this helps,

  • Asking about BPEL Process Manager  API information

    Hi,
    I am looking for BEPL PM API to have better administrative control from our application, mainly want to integrate the functionality to manually recover undelivered invoke/callback messages.
    I checked BPEL cookbook - http://www.oracle.com/technology/pub/articles/bpel_cookbook/blanvalet.html
    and it has a section of "BPEL Process Manager API and Dehydration Store", and the Link provided<$ORABPEL$\integration\orabpel\docs\apidocs\index.html> is for Java API.
    I have two questions here:
    1. Is there Java API which does recovery the undelivered messages?
    1. Is there PL/SQL API available? Is there one to handle recovery the undelivered messages?
    Thanks!
    Grace

    Hi me_sun, me_oracle :)
    The bpel api can be found here
    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm
    workflow found here
    http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28985/toc.htm
    when us install BPEL you do get BPELs human workflow component. This is different to the Oracle Oracle workflow which was based on the database and PL/SQL.
    cheers
    James

  • Oracle oas 10.1.3 oc4j java memory pools info...?

    Hello!
    I need to find info about java memory in JVM. What is :
    PS Eden Space
    PS Old Gen
    PS Perm Gen
    PS Survivor Space
    PS MarkSweep
    PS Scavenge
    regards - Marcin

    user8672998 wrote:
    Hello!
    I need to find info about java memory in JVM. What is :
    PS Eden Space
    PS Old Gen
    PS Perm Gen
    PS Survivor Space
    PS MarkSweep
    PS Scavenge
    regards - MarcinHi Marcin,
    To monitor the java memory and to find info on the memory pools & GC parameters, you must first verify that you are running OC4J on JDK release 5.0, and than you must set the jmxremote property for the OC4J instance.
    Using Application Server Control to Set the jmxremote System Property
    To set the enable monitoring of JVM J2SE 5.0 metrics from Application Server Control:
    1. Navigate to the OC4J Home page for the OC4J instance.
    2. Click Administration to display the OC4J Administration page, which contains a table listing the various administration tasks you can perform for this OC4J instance.
    3. If necessary, expand the Services section of the table by clicking the expand icon or by clicking Expand All.
    4. Click the task icon in the Server Properties row of the table to display the OC4J Server Properties page.
    5. Scroll down to the Command Line Options section of the page and select Enable J2SE 5.0 Platform MBeans.
    6. Click Apply to apply the changes.
    7. Navigate to the Cluster Topology page, select the OC4J instance, and then click Restart.
    Manually Setting the jmxremote System Property
    You can also enable monitoring of JVM J2SE 5.0 metrics manually, by including the following string as an OC4J runtime startup option:
    com.sun.management.jmxremote
    Refer the section "Setting System Properties at Startup" in the Oracle Containers for J2EE Configuration and Administration Guide for detailed instructions on how to specify OC4J runtime startup options.
    Specifically, if you are running OC4J in a standalone environment, you must include the following argument to the OC4J java command:
    java -Dcom.sun.management.jmxremote -jar oc4j.jar
    Or, if you are running OC4J in a Oracle Application Server managed environment, you must include the following argument in the start-parameters java-options element in the opmn.xml file:
    <ias-component id="OC4J">
    <process-type id="home" module-id="OC4J" status="enabled">
    <module-data>
    <category id="start-parameters">
    <data id="java-options" value="-Dcom.sun.management.jmxremote"/>
    </category>
    </module-data>
    </process-type>
    </ias-component>
    Regards,
    ~Pointer

  • How Transaction Manager work with Resource Manager, like Connection pool?

    hi,
    I'm using BEA Webloigc8.1 Stateless Session Bean/DAO/Oracle stored proc.
    but I'm not quite clear how Transaction Manager work with Resource Manager, like Connection pool.
    my understanding is that, in a weblogic transaction, a stateless session bean interact with several DAOs, and for each method of DAO a connection is acquired from connection pool. I've heard that the connection will not return to pool until the transaction commits.
    My question is that, does it mean that for a weblogic transaction, multiple connections might be allocated to it? and if multiple connections are allocated, then how many oracle transactions would be started? or multiple connections share the same oracle transaction?
    I didn't feel it make sense to start multiple oracle transactions, cause deadlock might be incurred in a single weblogic transaction.
    any help appreciated!

    Xin Zhuang wrote:
    hi,
    I'm using BEA Webloigc8.1 Stateless Session Bean/DAO/Oracle stored proc.
    but I'm not quite clear how Transaction Manager work with Resource Manager, like Connection pool.
    my understanding is that, in a weblogic transaction, a stateless session bean interact with several DAOs, and for each method of DAO a connection is acquired from connection pool. I've heard that the connection will not return to pool until the transaction commits.
    My question is that, does it mean that for a weblogic transaction, multiple connections might be allocated to it? and if multiple connections are allocated, then how many oracle transactions would be started? or multiple connections share the same oracle transaction?
    I didn't feel it make sense to start multiple oracle transactions, cause deadlock might be incurred in a single weblogic transaction.
    any help appreciated!Hi. If you configure your WLS DataSource to use keep a connection for
    the duration of a tx, it will do that, and in any case there can be
    no deadlock however many connections operate for a given XA transaction.
    Here is the best coding form for DAOs or any other user-written code
    for using WebLogic DataSources. This is important for two reasons:
    1 - Thread-safety is maintained as long as the connection is a
    method-level object.
    2 - It is crucial to notify WebLogic that you are done with a connection
    ASAP, by your calling close() on it. We will then put it back in the
    pool, or keep it under the covers for your next request if it's in a
    transaction etc. The pool is optimized for quick get-use-close scenarios.
    public void one_of_my_main_JDBC_Methods()
    Connection con=null; // Must be a method level object for thread-safety
    // It will be closed by the end of the method.
    try {
    con = myDataSource.getConnection(); // Get the connection in the try
    // block, directly from the WebLogic
    // datasource
    // do all the JDBC within this try block. You can pass the
    // connection to subordinate methods, but not to anywhere
    // that thinks it can use the connection later.
    rs.close(); // close any result set asap
    stmt.close(); // then close any statement asap
    // When you're done with JDBC
    con.close(); // close the connection asap
    con = null; // nullify it so the finally knows it's done
    catch (Exception e) {
    // do whatever catch stuff you want. You don't
    // need a catch block if you don't want one...
    finally {
    // It is important to close a JDBC connection ASAP when it's not needed.
    // without fail, and regardless of exit path. Do everything in your
    // finally block in it's own try-catch-ignore so everything is done.
    try { if (con != null) con.close();} catch (Exception ignore){}
    return ret;
    }

  • Fetching all mails in Inbox from Exchange Web Services Managed API and storing them as a .eml files

    I want to fetch all mails in the Inbox folder using EWS Managed API and store them as .eml.
    I can store file once I get the file content as a byte[] will
    not be difficult, as I can do:
    File.WriteAllBytes("c:\\mails\\"+mail.Subject+".eml",content);
    The problem will be to fetch (1) all mails with (2)
    all headers (like from, to, subject) (I am keeping information of those values of from, to and
    other properties somewhere else, so I need them too) and (3)byte[]
    EmailMessage.MimeContent.Content. Actually I am lacking understanding of
    Microsoft.Exchange.WebServices.Data.ItemView,
    Microsoft.Exchange.WebServices.Data.BasePropertySet and
    Microsoft.Exchange.WebServices.Data.ItemSchema
    thats why I am finding it difficult.
    My primary code is:
    When I create PropertySet as
    follows:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
    I get following exception:
    The property MimeContent can't be used in FindItem requests.
    I dont understand
    (Q1) What these ItemSchema and BasePropertySet are
    (Q2) And how we are supposed to use them
    So I removed ItemSchema.MimeContent:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties);
    I wrote simple following code to get all mails in inbox:
    ItemView view = new ItemView(50);
    view.PropertySet = properties;
    FindItemsResults<Item> findResults;
    List<EmailMessage> emails = new List<EmailMessage>();
    do
    findResults = service.FindItems(WellKnownFolderName.Inbox, view);
    foreach (var item in findResults.Items)
    emails.Add((EmailMessage)item);
    Console.WriteLine("Loop");
    view.Offset = 50;
    while (findResults.MoreAvailable);
    Above I kept page size of ItemView to
    50, to retrieve no more than 50 mails at a time, and then offsetting it by 50 to get next 50 mails if there are any. However it goes in infinite loop and continuously prints Loop on
    console. So I must be understanding pagesize and offset wrong.
    I want to understand
    (Q3) what pagesize, offset and offsetbasepoint in ItemView constructor
    means
    (Q4) how they behave and
    (Q5) how to use them to retrieve all mails in the inbox
    I didnt found any article online nicely explaining these but just giving code samples. Will appreciate question-wise explanation despite it may turn long.

    1) With FindItems it will only return a subset of Item properties see
    http://msdn.microsoft.com/en-us/library/bb508824(v=exchg.80).aspx for a list and explanation. To get the mime content you need to use a GetItem (or Load) I would suggest you read
    http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx which also covers of paging as well.
    3) offset is from the base your setting the offset to 50 each time which means your only going to get the 50 items from the offset of 50 which just creates an infinite loop. You should use
    view.Offset
    = +50;
    to increment the Offset although it safer to use
    view.Offset  += findResults.Items.Count;
    which increments the offset based on the result of the last FindItems operation.
    5) try something like
    ItemView iv = new ItemView(100, 0);
    FindItemsResults<Item> firesults = null;
    PropertySet psPropSet = new PropertySet(BasePropertySet.IdOnly);
    iv.PropertySet = psPropSet;
    PropertySet itItemPropSet = new PropertySet(BasePropertySet.IdOnly) { ItemSchema.MimeContent, ItemSchema.Subject, EmailMessageSchema.From };
    do
    firesults = service.FindItems(WellKnownFolderName.Inbox, iv);
    service.LoadPropertiesForItems(firesults.Items, itItemPropSet);
    foreach(Item itItem in firesults){
    Object MimeContent = null;
    if(itItem.TryGetProperty(ItemSchema.MimeContent,out MimeContent)){
    Console.WriteLine("Processing : " + itItem.Subject);
    iv.Offset += firesults.Items.Count;
    } while (firesults.MoreAvailable);
    Cheers
    Glen
    .Offset += fiFitems.Items.Count;

  • ConversationId property vs ConversationIndex property in Exchange Web Services managed API

    EWS Managed API have two properties:ConversaionId and ConversationIndex
    What is the difference between them? I guess ConversationId is
    the the ConversationIndex of
    the first mail in the conversation which is essentially of 22 bytes, while ConversationIndex is
    the index of that particular reply in the conversation thread, essentially of 22 bytes + multiples of 5 bytes for each reply in the conversation. Is it like that?
    Also ConversationId is
    accessible only with Exchange Server 2010 onwards. So cant we access ConversationId in
    the Exchange Server 2007?

    I just found this thread that indicates that you can use an extended property definition to access the ConversationId in Exchange 2007. Very smart!
    http://stackoverflow.com/questions/7487570/implementing-outlook-2010s-group-by-conversation-using-ews-and-exchange-2007
    Henning's answer:
    You can fetch the ConversationId and the ConversationIndex via extended properties:
    private static readonly ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
    private static readonly ExtendedPropertyDefinition ConversationIndexProperty = new ExtendedPropertyDefinition(0x0071, MapiPropertyType.Binary);
    var items = service.FindItems(WellKnownFolderName.Inbox, new ItemView(512) { PropertySet = new PropertySet(BasePropertySet.FirstClassProperties,
    ConversationIdProperty, ConversationIndexProperty)});
    Both are binary properties. Their content is described in great detail here:
    [MS-OXOMSG]: E-Mail Object Protocol Specification, section 2.2.1.2 and 2.2.1.3.
    The properties themselves are defined in
    [MS-OXPROPS]: Exchange Server Protocols Master Property List.

  • Create and send an email as a delegate using EWS Managed API

    Hi All,
    I would like to create and send an email as a delegate using EWS Managed API for that i have crated one user as a delegate to that mailbox owner.
    after adding user as delegate, when i try to create an email The EmailMessage class taking only FolderId as parameter but not taking Mailbox object as parameter. But in web reference they said that EmailMessage taking FolderId and Mailbox object as parameter.
    EmailMessage message = new EmailMessage(service);
    message.Subject = "Company Soccer Team";
    message.Body = "Are you interested in joining?";
    message.ToRecipients.Add("[email protected]");
    message.Save(new FolderId(WellKnownFolderName.Drafts, new Mailbox("[email protected]")));https://msdn.microsoft.com/EN-US/library/office/dn641963(v=exchg.150).aspx#bk_createewsmacould you people please help me on this?ThanksNaresh

    Thanks for reply glen.
    I have added delegate using Add-MailboxPermissions. Now i am able to save an email in mailbox owner drafts
    folder.
    Glen,
     I have a one more question.(I am using EWS Managed API).
    I(owner) have shared my calendar(eg. samplecalenderfolder) with another user(delegate) (i.e.,he is the
    delegate of my mailbox) and i have given only permission to the this folder(samplecalenderfolder)
    only and the permission level is Reviewer.
    if i login with user(i.e.delegate) i am not able to get the shared calendar folders(i.e.,samplecalenderfolder)
    that what i a have shared.
    below is the code snippet i am using to get the calendar folders.
    Folder folder = Folder.Bind(service,WellKnownFolderName.Calendar);
    FindFoldersResults addtionalFolders = service.FindFolders(folder.Id, new FolderView(10));
    could you please tell us how to get the shared calendar folders.
    Thanks
    Naresh

Maybe you are looking for