2011-08-15 3 views
0

ashydrator에서 생성 한 asp.net 4에서 나머지 서비스를 만들었습니다. 서비스를 실행하고 서비스 도움말 페이지를 탐색 할 때 많은 관계가있는 복잡한 메소드를 선택하고 예제를 사용하면 w3wp.exe가 3 분 안에 모든 서버 메모리를 사용하기 시작하고 서비스가 outofmemoeryexception을 반환합니다. 난 정말이 문제와 혼란 스러워요, 어떤 도움을 많이 주셔서 감사합니다, 내가 requsting 모든 데이터 JSON 작은 패킷이지만 복잡한이 방법에 대한 매핑 된 테이블입니다.WCF 메모리에 문제가 있습니다

public class DataService : IDataService 
    { 
     /// <summary> 
     /// Get a list of all GetJobList DTO items 
     /// </summary> 
     public List<di.testproj.DataTransfer.Job> GetJobList() 
     { 
      var retval = new List<di.testproj.DataTransfer.Job>(); 
      retval.RunSelect(); 
      return retval; 
     } 
    } 



[ServiceContract] 
    public interface IDataService 
    { 

     #region Job Select All 

     /// <summary> 
     /// Get a list of all Job DTO items 
     /// </summary> 
     /// 
     [WebGet(UriTemplate = "JobList", ResponseFormat = WebMessageFormat.Json)] 
     [Description("Description for GET /JobList")] 
     [OperationContract] 
     List<di.testproj.DataTransfer.Job> GetJobList(); 

     #endregion 
    } 

DTO 레이어 :

[Serializable()] 
    [DataContract()] 
    public partial class Job : IDTO 
    { 
     #region Class Members 

     #region FieldNameConstants Enumeration 

     /// <summary> 
     /// An enumeration of this object's fields 
     /// </summary> 
     public enum FieldNameConstants 
     { 
      /// <summary> 
      /// Field mapping for the 'SectorID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'SectorID' property")] 
      SectorID, 
      /// <summary> 
      /// Field mapping for the 'SectionID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'SectionID' property")] 
      SectionID, 
      /// <summary> 
      /// Field mapping for the 'ReportingToID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'ReportingToID' property")] 
      ReportingToID, 
      /// <summary> 
      /// Field mapping for the 'PreferredQualificationsEn' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'PreferredQualificationsEn' property")] 
      PreferredQualificationsEn, 
      /// <summary> 
      /// Field mapping for the 'PreferredQualificationsAr' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'PreferredQualificationsAr' property")] 
      PreferredQualificationsAr, 
      /// <summary> 
      /// Field mapping for the 'PreferredExperinceEn' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'PreferredExperinceEn' property")] 
      PreferredExperinceEn, 
      /// <summary> 
      /// Field mapping for the 'PreferredExperinceAr' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'PreferredExperinceAr' property")] 
      PreferredExperinceAr, 
      /// <summary> 
      /// Field mapping for the 'JobTypeID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobTypeID' property")] 
      JobTypeID, 
      /// <summary> 
      /// Field mapping for the 'JobTitleEn' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobTitleEn' property")] 
      JobTitleEn, 
      /// <summary> 
      /// Field mapping for the 'JobTitleAr' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobTitleAr' property")] 
      JobTitleAr, 
      /// <summary> 
      /// Field mapping for the 'JobObjectiveEn' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobObjectiveEn' property")] 
      JobObjectiveEn, 
      /// <summary> 
      /// Field mapping for the 'JobObjectiveAr' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobObjectiveAr' property")] 
      JobObjectiveAr, 
      /// <summary> 
      /// Field mapping for the 'JobID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobID' property")] 
      JobID, 
      /// <summary> 
      /// Field mapping for the 'JobFamilyID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobFamilyID' property")] 
      JobFamilyID, 
      /// <summary> 
      /// Field mapping for the 'JobCategoryID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'JobCategoryID' property")] 
      JobCategoryID, 
      /// <summary> 
      /// Field mapping for the 'IsActive' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'IsActive' property")] 
      IsActive, 
      /// <summary> 
      /// Field mapping for the 'ID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'ID' property")] 
      ID, 
      /// <summary> 
      /// Field mapping for the 'DivisionID' property 
      /// </summary> 
      [System.ComponentModel.Description("Field mapping for the 'DivisionID' property")] 
      DivisionID, 
     } 

     #endregion 

     #endregion 

     #region Constructors 

     /// <summary> 
     /// The default contructor for the Job DTO 
     /// </summary> 
     public Job() 
     { 
     } 

     #endregion 

     #region Object Properties 

     /// <summary> 
     /// The DivisionID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? DivisionID { get; set; } 
     /// <summary> 
     /// The ID field 
     /// </summary> 
     [DataMember()] 
     public virtual int ID { get; set; } 
     /// <summary> 
     /// The IsActive field 
     /// </summary> 
     [DataMember()] 
     public virtual bool? IsActive { get; set; } 
     /// <summary> 
     /// The JobCategoryID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? JobCategoryID { get; set; } 
     /// <summary> 
     /// The JobFamilyID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? JobFamilyID { get; set; } 
     /// <summary> 
     /// The JobID field 
     /// </summary> 
     [DataMember()] 
     public virtual int JobID { get; set; } 
     /// <summary> 
     /// The JobObjectiveAr field 
     /// </summary> 
     [DataMember()] 
     public virtual string JobObjectiveAr { get; set; } 
     /// <summary> 
     /// The JobObjectiveEn field 
     /// </summary> 
     [DataMember()] 
     public virtual string JobObjectiveEn { get; set; } 
     /// <summary> 
     /// The JobTitleAr field 
     /// </summary> 
     [DataMember()] 
     public virtual string JobTitleAr { get; set; } 
     /// <summary> 
     /// The JobTitleEn field 
     /// </summary> 
     [DataMember()] 
     public virtual string JobTitleEn { get; set; } 
     /// <summary> 
     /// The JobTypeID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? JobTypeID { get; set; } 
     /// <summary> 
     /// The PreferredExperinceAr field 
     /// </summary> 
     [DataMember()] 
     public virtual string PreferredExperinceAr { get; set; } 
     /// <summary> 
     /// The PreferredExperinceEn field 
     /// </summary> 
     [DataMember()] 
     public virtual string PreferredExperinceEn { get; set; } 
     /// <summary> 
     /// The PreferredQualificationsAr field 
     /// </summary> 
     [DataMember()] 
     public virtual string PreferredQualificationsAr { get; set; } 
     /// <summary> 
     /// The PreferredQualificationsEn field 
     /// </summary> 
     [DataMember()] 
     public virtual string PreferredQualificationsEn { get; set; } 
     /// <summary> 
     /// The ReportingToID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? ReportingToID { get; set; } 
     /// <summary> 
     /// The SectionID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? SectionID { get; set; } 
     /// <summary> 
     /// The SectorID field 
     /// </summary> 
     [DataMember()] 
     public virtual int? SectorID { get; set; } 

     #endregion 

     #region Navigation Properties 

     /// <summary> 
     /// The relation Job -> Competency 
     /// </summary> 
     [DataMember()] 
     public virtual IList<Competency> CompetencyList { get; set; } 

     /// <summary> 
     /// The relation Job -> JobDuty (Role: Jobduties_jobs) 
     /// </summary> 
     [DataMember()] 
     public virtual IList<JobDuty> Jobduties_jobsJobDutyList { get; set; } 

     /// <summary> 
     /// The relation Job -> Job (Role: Jobs_jobs) 
     /// </summary> 
     [DataMember()] 
     public virtual IList<Job> Jobs_jobsJobList { get; set; } 

     /// <summary> 
     /// The relation JobCategorie -> Job (Role: Jobs_jobcategories) 
     /// </summary> 
     [DataMember()] 
     public virtual JobCategorie Jobs_jobcategoriesJobCategorie { get; set; } 

     /// <summary> 
     /// The relation JobFamily -> Job (Role: Jobs_jobfamilies) 
     /// </summary> 
     [DataMember()] 
     public virtual JobFamily Jobs_jobfamiliesJobFamily { get; set; } 

     /// <summary> 
     /// The relation Job -> Job (Role: Jobs_jobs) 
     /// </summary> 
     [DataMember()] 
     public virtual Job Jobs_jobsJob { get; set; } 

     /// <summary> 
     /// The relation JobType -> Job (Role: Jobs_jobtypes) 
     /// </summary> 
     [DataMember()] 
     public virtual JobType Jobs_jobtypesJobType { get; set; } 

     /// <summary> 
     /// The relation Sector -> Job (Role: Jobs_sectors) 
     /// </summary> 
     [DataMember()] 
     public virtual Sector Jobs_sectorsSector { get; set; } 

     #endregion 

    } 

} 


public static void RunSelect(this List<di.testproj.DataTransfer.Competency> list) 
     { 
      if (list == null) list = new List<di.testproj.DataTransfer.Competency>(); 
      var retval = di.testproj.Business.Objects.CompetencyCollection.RunSelect(); 
      foreach (di.testproj.Business.Objects.Competency item in retval) 
      { 
       var newItem = new di.testproj.DataTransfer.Competency(); 
       newItem.Fill(item); 
       list.Add(newItem); 
      } 
     } 

어떤 도움도 좋은 것입니다.

답변

0

여기서 평범하지 않은 것을 볼 수 없습니다. 어쩌면 서비스 메소드의 코드와 사용중인 데이터 계약을 추가 할 수 있습니다.

+0

안녕하세요, 조사 후 편집 된 질문을 확인하십시오 – Madi

+0

RunSelect() 란 무엇입니까? 나는 DB 작업을하는 확장 메소드를 추측하고있다. – Maurice

+0

예 Maurice, DB에서 항목 가져 오기 – Madi

관련 문제