0

I am facing a very complicated situation with kentico repeater transformation, where I have created 3 custom repeaters to process the following attachments fields "Images, Reports and Files", which i created in the page type to separate attachments by type. so to process my data I followed this post to create the below transformation:

    <%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %><%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachmentsVideo.ascx" TagName="DocumentAttachmentsVideo" TagPrefix="cms" %>


< script runat="server">
   protected override void OnInit(EventArgs e)
{
    CMS.DataEngine.DataClassInfo dci = CMS.DataEngine.DataClassInfoProvider.GetDataClassInfo(Eval("ClassName").ToString(), true);

    if (dci != null)
    {
       CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(dci.ClassFormDefinition);
        // field name we added in the page type
    CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("Images");
    CMS.FormEngine.FormFieldInfo ffiReports = fi.GetFormField("Reports");
    CMS.FormEngine.FormFieldInfo ffiFiles = fi.GetFormField("Files");

     Guid AttachmentGroupGUID = ffi.Guid;
     Guid AttachmentGroupGUIDRep = ffiReports.Guid;
     Guid AttachmentGroupGUIDFil = ffiFiles.Guid;

    ucDocAttachments.Path = Eval<string>("NodeAliasPath");
    ucDocAttachmentReports.Path = Eval<string>("NodeAliasPath");
    ucDocAttachmentFil.Path = Eval<string>("NodeAliasPath");

       ucDocAttachments.AttachmentGroupGUID = AttachmentGroupGUID;
       ucDocAttachmentReports.AttachmentGroupGUID = AttachmentGroupGUIDRep;
       ucDocAttachmentFil.AttachmentGroupGUID = AttachmentGroupGUIDFil;

     ucDocAttachments.TransformationName = "CMS.Root.Attachment";
     ucDocAttachmentReports.TransformationName = "CMS.Root.AttachmentLinks";
     ucDocAttachmentFil.TransformationName = "CMS.Root.AttachmentLinks";

     ucDocAttachments.StopProcessing = false;
    ucDocAttachmentReports.StopProcessing = false;
    ucDocAttachmentFil.StopProcessing = false;

    ucDocAttachments.ReloadData(true);
    ucDocAttachmentReports.ReloadData(true);
    ucDocAttachmentFil.ReloadData(true);
    }
}
< /script>


    <div class="innerSelectedElectionContainer col-xs-12 selected-<%# DataItemIndex %>">
    <div class="col-xs-12 selectedElectionInfo selectedContent-0">
        <div class="col-xs-12 selectedElectionTitle elem-to-hide">
            <%# Eval("Title") %>
        </div>
        <div class="col-xs-12 selectedElectionText elem-to-hide">
            <%# Eval("Text") %>
        </div>
    </div>
    <div class="selectedElectionInfo elem-to-hide selectedContent-1">
        <div class="col-xs-12 photosLabel"><%# Localize("{$photosGallery$}") %></div>
       <div class="col-xs-12 noPaddingSides FlexWrap"> <cms:DocumentAttachments ID="ucDocAttachments" runat="server" PageSize="100" GetBinary="false" />

          </div>
    </div>
    <div class="selectedElectionInfo elem-to-hide selectedContent-2 col-xs-12">
        <div class="col-xs-12 photosLabel"><%# Localize("{$videosGallery$}") %></div><cms:DocumentAttachmentsVideo ID="DocumentAttachmentsVideo" runat="server"  GetBinary="false" StopProcessing="true" ImageFieldValues='<%# Eval("Videos") %>' />
    </div>
    <div class="selectedElectionInfo elem-to-hide selectedContent-3">
              <div class="col-xs-12 photosLabel"><%# Localize("{$reports$}") %></div>
       <div class="col-xs-12 selectedContent-3 ElectionReports"><cms:DocumentAttachments ID="ucDocAttachmentReports" PageSize="100"  runat="server" GetBinary="false"  StopProcessing="true" /> </div>
    </div>
    <div class="selectedElectionInfo elem-to-hide selectedContent-4">
       <div class="col-xs-12 photosLabel"><%# Localize("{$files$}") %></div>
       <div class="col-xs-12 selectedContent-4 ElectionFiles"><cms:DocumentAttachments ID="ucDocAttachmentFil" PageSize="100" runat="server" GetBinary="false" StopProcessing="true" /> 
         </div>
    </div></div>

But the problem is that the system is now returning an out of memory exception, which was for certain time temporary, but now the website is not processing at all, i am having a hard time finding the reason, because the system works for some data, and after a certain refresh it returns the exception for the same data, so its random, here's a screenshot for the event logs:

Screenshot one

Screenshot Two

Screenshot Three

Screenshot Four

Screenshot Five

when referring back to the code behind I found that the exception is executing on this line: ucRepeater.DataSource = ucDataSource.DataSource;

Does someone knows whats wrong and how can I fix this??

user4261201
  • 2,324
  • 19
  • 26

1 Answers1

0

You can continue posting in your original thread here, even if it's answers:

https://devnet.kentico.com/questions/system-outofmemoryexception

If there binary didn't fix it permanently, and If you still have memory issues I would look at the database or web server if you are running out of memory in general.

Also check system > general and see how much memory is being used in the cache, if you are caching to much that may be causing your memory to reach it's limit.

Trevor F
  • 1,429
  • 9
  • 6
  • Thank you trevor, well no I tried to add "GetBinary = false" and it worked for a short time then it went back to giving the same exception, after some data filling, actually I dont think this is related to the physical memory, as per this link https://stackoverflow.com/questions/1153702/system-outofmemoryexception-was-thrown-when-there-is-still-plenty-of-memory-fr , do you have another opinion? – farah el agha Jan 15 '18 at 14:05
  • Hello trevor, you didnt get back to me, I m still facing the same problem, do you have any other suggestions that can help me? – farah el agha Jan 16 '18 at 15:22