function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bvramkumarbvramkumar 

Governor limits when using 4 VF pages in one VF page.

A Question to the boarders:
If I am using apex:include to include 4 VF pages in another VF page, Will it take governor limits for each separately Or is it combined? And suppose that those 4 VF pages have their own controllers. I think the limits are separate for each page. Like to know what others think about this. Probably someone has a solid answer....

 

Thanks.... 

Best Answer chosen by Admin (Salesforce Developers) 
SamuelDeRyckeSamuelDeRycke

limits are page request based, so I would expect all pages loaded are seen as a single request, with a single set of limits.

All Answers

SamuelDeRyckeSamuelDeRycke

limits are page request based, so I would expect all pages loaded are seen as a single request, with a single set of limits.

This was selected as the best answer
sfdcfoxsfdcfox

Sdry is correct.

 

Each transaction will have a governor limit equal to the initial request (e.g. if it is a Visualforce page, the VF governor limits apply, even if DMLs that call triggers are in effect).

 

I created three pages that illusrate this effect:

 

25.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
08:57:26.098 (98193000)|EXECUTION_STARTED
08:57:26.098 (98243000)|CODE_UNIT_STARTED|[EXTERNAL]|06650000000MQYA|VF: /apex/phyrfox__inclu
08:57:26.124 (124256000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWt|inc1 <init>
08:57:26.124 (124282000)|SYSTEM_MODE_ENTER|true
08:57:26.125 (125294000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:1
08:57:26.125 (125316000)|METHOD_ENTRY|[1]|01p50000000RWWt|inc1.inc1()
08:57:26.125 (125324000)|STATEMENT_EXECUTE|[1]
08:57:26.125 (125449000)|SYSTEM_MODE_ENTER|false
08:57:26.125 (125469000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125481000)|STATEMENT_EXECUTE|[1]
08:57:26.125 (125487000)|SYSTEM_MODE_EXIT|false
08:57:26.125 (125496000)|METHOD_EXIT|[1]|inc1
08:57:26.125 (125512000)|VARIABLE_SCOPE_BEGIN|[1]|this|phyrfox.inc1|true|false
08:57:26.125 (125544000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x7d65cb41
08:57:26.125 (125551000)|SYSTEM_MODE_ENTER|false
08:57:26.125 (125556000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125620000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:1
08:57:26.125 (125638000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125655000)|VARIABLE_SCOPE_BEGIN|[2]|this|system.ApexBaseClass|true|false
08:57:26.125 (125674000)|VARIABLE_ASSIGNMENT|[2]|this|{}|0x7d65cb41
08:57:26.125 (125680000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125693000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125702000)|SYSTEM_MODE_EXIT|false
08:57:26.125 (125708000)|STATEMENT_EXECUTE|[1]
08:57:26.125 (125712000)|SYSTEM_MODE_ENTER|false
08:57:26.125 (125716000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.125 (125723000)|SYSTEM_MODE_EXIT|false
08:57:26.125 (125733000)|CODE_UNIT_FINISHED|inc1 <init>
08:57:26.125 (125762000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWt|inc1 get(name)
08:57:26.125 (125769000)|SYSTEM_MODE_ENTER|true
08:57:26.125 (125781000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWt|inc1 invoke(getname)
08:57:26.125 (125820000)|SYSTEM_MODE_ENTER|false
08:57:26.125 (125826000)|HEAP_ALLOCATE|[4]|Bytes:5
08:57:26.125 (125835000)|STATEMENT_EXECUTE|[3]
08:57:26.125 (125839000)|STATEMENT_EXECUTE|[4]
08:57:26.125 (125861000)|HEAP_ALLOCATE|[4]|Bytes:36
08:57:26.128 (128980000)|SOQL_EXECUTE_BEGIN|[4]|Aggregations:0|select id, name from account limit 1
08:57:26.133 (133001000)|SOQL_EXECUTE_END|[4]|Rows:1
08:57:26.133 (133026000)|HEAP_ALLOCATE|[4]|Bytes:8
08:57:26.133 (133042000)|HEAP_ALLOCATE|[4]|Bytes:48
08:57:26.133 (133160000)|HEAP_ALLOCATE|[4]|Bytes:52
08:57:26.133 (133179000)|HEAP_ALLOCATE|[4]|Bytes:33
08:57:26.133 (133282000)|HEAP_ALLOCATE|[4]|Bytes:44
08:57:26.133 (133331000)|SYSTEM_MODE_EXIT|false
08:57:26.133 (133343000)|CODE_UNIT_FINISHED|inc1 invoke(getname)
08:57:26.133 (133355000)|CODE_UNIT_FINISHED|inc1 get(name)
08:57:26.133 (133723000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWy|inc2 <init>
08:57:26.133 (133736000)|SYSTEM_MODE_ENTER|true
08:57:26.133 (133776000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:1
08:57:26.133 (133802000)|METHOD_ENTRY|[1]|01p50000000RWWy|inc2.inc2()
08:57:26.133 (133813000)|STATEMENT_EXECUTE|[1]
08:57:26.133 (133821000)|SYSTEM_MODE_ENTER|false
08:57:26.133 (133830000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.133 (133844000)|STATEMENT_EXECUTE|[1]
08:57:26.133 (133851000)|SYSTEM_MODE_EXIT|false
08:57:26.133 (133870000)|METHOD_EXIT|[1]|inc2
08:57:26.133 (133891000)|VARIABLE_SCOPE_BEGIN|[1]|this|phyrfox.inc2|true|false
08:57:26.133 (133930000)|VARIABLE_ASSIGNMENT|[1]|this|{}|0x147f91d3
08:57:26.133 (133941000)|SYSTEM_MODE_ENTER|false
08:57:26.133 (133948000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.133 (133967000)|VARIABLE_SCOPE_BEGIN|[2]|this|system.ApexBaseClass|true|false
08:57:26.133 (133991000)|VARIABLE_ASSIGNMENT|[2]|this|{}|0x147f91d3
08:57:26.134 (134001000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.134 (134021000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.134 (134034000)|SYSTEM_MODE_EXIT|false
08:57:26.134 (134043000)|STATEMENT_EXECUTE|[1]
08:57:26.134 (134050000)|SYSTEM_MODE_ENTER|false
08:57:26.134 (134056000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
08:57:26.134 (134066000)|SYSTEM_MODE_EXIT|false
08:57:26.134 (134079000)|CODE_UNIT_FINISHED|inc2 <init>
08:57:26.134 (134116000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWy|inc2 get(name)
08:57:26.134 (134126000)|SYSTEM_MODE_ENTER|true
08:57:26.134 (134142000)|CODE_UNIT_STARTED|[EXTERNAL]|01p50000000RWWy|inc2 invoke(getname)
08:57:26.134 (134209000)|SYSTEM_MODE_ENTER|false
08:57:26.134 (134219000)|HEAP_ALLOCATE|[4]|Bytes:5
08:57:26.134 (134233000)|STATEMENT_EXECUTE|[3]
08:57:26.134 (134240000)|STATEMENT_EXECUTE|[4]
08:57:26.134 (134252000)|HEAP_ALLOCATE|[4]|Bytes:36
08:57:26.134 (134727000)|SOQL_EXECUTE_BEGIN|[4]|Aggregations:0|select id, name from contact limit 1
08:57:26.164 (164402000)|SOQL_EXECUTE_END|[4]|Rows:1
08:57:26.164 (164428000)|HEAP_ALLOCATE|[4]|Bytes:8
08:57:26.164 (164441000)|HEAP_ALLOCATE|[4]|Bytes:50
08:57:26.164 (164515000)|HEAP_ALLOCATE|[4]|Bytes:54
08:57:26.164 (164532000)|HEAP_ALLOCATE|[4]|Bytes:33
08:57:26.164 (164603000)|HEAP_ALLOCATE|[4]|Bytes:46
08:57:26.164 (164637000)|SYSTEM_MODE_EXIT|false
08:57:26.164 (164649000)|CODE_UNIT_FINISHED|inc2 invoke(getname)
08:57:26.164 (164660000)|CODE_UNIT_FINISHED|inc2 get(name)
08:57:26.655 (173347000)|CUMULATIVE_LIMIT_USAGE
08:57:26.655|LIMIT_USAGE_FOR_NS|phyrfox|
  Number of SOQL queries: 2 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of script statements: 2 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

08:57:26.655|CUMULATIVE_LIMIT_USAGE_END

08:57:26.173 (173378000)|CODE_UNIT_FINISHED|VF: /apex/phyrfox__inclu
08:57:26.173 (173388000)|EXECUTION_FINISHED

 The source is as follows:

 

incl.page:

 

<apex:page >
    <apex:include pageName="{!$Page.inc1}" />
    <apex:include pageName="{!$Page.inc2}" />
</apex:page>

inc1.page:

 

<apex:page controller="inc1">
    {!name}
</apex:page>

inc2.page:

 

<apex:page controller="inc2">
    {!name}
</apex:page>

Inc1.class:

 

public with sharing class inc1 {

    public String getName() {
        return [select id,name from account limit 1].name;
    }

}

inc2.class:

 

public with sharing class inc2 {

    public String getname() {
        return [select id,name from contact limit 1].name;
    }
}

When you read the logs, you will see the cumulative usage is 2 statements, 2 rows returned. This empirically proves that the usage is cumulative across all pages.

 

 

bvramkumarbvramkumar
Thank you so much.