Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사]
조회: 13495
글쓴 사람
dev00
홈페이지
첨부 파일
 

안녕하세요^^

아래와 같은 상황에 대하여 궁금한점이 발생하여 질문드립니다.

제가 알기로는 QUEUE 에 크기는 무제한이라고 알고있는데 (제 컴퓨터 기준 중간에 OUT OF MEMORY가 뜹니다)

이유가 무엇인지 궁금합니다


추가1. 소스상의 for 구문중 i 가 134217728 일때 멈춥니다.
추가2. 혹시나하고 List<int>로해도 i가 134217728 일때 멈춥니다.

사용하고 있는 visualStudio는 2015 Commnuity 버전입니다.

---------소스코드----------------using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> test1 = new Queue<int>();

            for(int i=0; i <1000000000; i++)
            {
                test1.Enqueue(i);
            }

            Console.Write("테스트");
        }
    }
}

----예외정보-------------------
System.OutOfMemoryException이(가) 처리되지 않았습니다.
  HResult=-2147024882
  Message='System.OutOfMemoryException' 형식의 예외가 Throw되었습니다.
  Source=System
  StackTrace:
       / System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
       / System.Collections.Generic.Queue`1.Enqueue(T item)
       / ConsoleApplication1.Program.Main(String[] args) 파일 C:\Users\1234\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:줄 18
       / System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       / System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       / Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       / System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       / System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       / System.Threading.ThreadHelper.ThreadStart()
  InnerException:








[최초 등록일: ]
[최종 수정일: 9/17/2016]


비밀번호

댓글 작성자
 



2016-09-17 10시56분
StringBuilder 에서의 OutOfMemoryException 오류 원인 분석
; http://www.sysnet.pe.kr/2/0/1171

.NET 64비트 응용 프로그램에서 왜 (2GB) OutOfMemoryException 예외가 발생할까?
; http://www.sysnet.pe.kr/2/0/946
정성태
2016-09-17 11시43분
[dev00] 정성태//답변감사합니다. 그런데 왜 2GB 바이트가 아니라 128MB 에서 멈추는걸까요?
[guest]
2016-09-18 01시31분
128MB가 아닙니다. 다시 계산해 보세요.
정성태

... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
5539초초초촙8/9/20214818c# textbox 입력값이 다름 [1]파일 다운로드1
5538VS8/7/20215097vsmacros 확장자 파일을 사용하는 방법을 알 수 있을까요? [2]
5537민성8/6/20215327안녕하세요 WPF에서 이미 있는창이 있다면 안띠우게 하는 방법 [1]
55358/5/20216845안녕하세요. 초보 웹 개발자입니다. [10]파일 다운로드2
5534하영7/28/20215378clrprofiler 를 사용하여 세션정보 접근 [6]파일 다운로드1
5533함준혁7/20/20214876.net fpspread 관련 질문입니다.. [1]
5532조윤상7/15/20216214바인딩은 성공 했습니다. 그런데 브라우저에서 인증서가 없다고 나옵니다. [2]
5530ocm7/14/20215831pthread_create [7]파일 다운로드1
5529ksc7/13/20215009Source Generator 관련 질문이 있습니다. [1]
5528초심으로7/9/20216166MDI 에서 USB 연결해제 알림이 안되는 문제 질문 드려봅니다. [7]파일 다운로드1
5527wuny7/7/20215090제어관련 고민을하다가 소캣방식 선택 [2]
5526이성열 donator7/7/20216665wpf x64로 만든 메인 프로그램에서 dll로 된 UserControl 속성이 디자인타임에 잘 안보이는 문제 [10]파일 다운로드2
5525Wuny7/7/20217222제가 만든 배포파일은 window에서 막는걸까요? [2]파일 다운로드1
5524하이스컬7/2/20216532특정 이벤트에서 다른 이벤트 호출 관련 문의 [3]
5523민우7/1/202112269도커 사용시 윈도우 이미지 생성도 가능한가요? [2]
5522질문6/28/20216952WPF에서 splash screen이 나타나는 위치를 변경할 수 있나요? [3]
5521김민혁6/24/20217041.exe 파일 에러에 관한 질문 입니다. [3]
5520한예지 donator6/21/20216819랜덤함수 질문있습니다!! [2]
5519리얼킴6/19/20215769.net framwork 4.0 에서 4.8로 꼭 가야할까요?? [1]
5518한예지 donator6/18/20216484ArrayList, IList에 대해 질문 있습니다. [3]
5517wunsy6/18/20216908winform에서 Button 활성화, 비활성화 [4]
5516ocm6/15/20215919mips 어셈블리 연산 다시 질문드려요 (첨부파일 갱신됨) [2]파일 다운로드1
5515ocm6/14/20216800mips 어셈블리 연산 [6]파일 다운로드1
5514jongs6/11/20217508GethashCode와 String대한 질문 [2]
5513labe...6/11/20217241C# Winform 에서 Label에 동일한 Color를 넣었을 때 처리방법이 궁금합니다. [2]
55126/11/20218026xlwings 가 실행조차 되지 않습니다. ㅠㅠ [7]
... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...