Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사]
조회: 13485
글쓴 사람
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가 아닙니다. 다시 계산해 보세요.
정성태

1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5645김인태4/6/20223535윈도우즈 서버의 AD 계정 생성 조건이 있을까요? [1]
5644ㅇㅇ4/6/20224299c# 프로그램을 이용하여 리눅스상에 파일 생성이 가능한가요? [1]
5643유필재4/5/20224179TCP클라이언트 연결 및 통신관련하여 문의드려요 [1]
5642차가워4/4/20224422UdpClient 패킷 수신 문의 [4]
5641장성욱4/4/20224832코어 할당 및 cpu 부하테스트 질문 [7]
5640icoo...4/4/20224355웹가든에서 메모리 동적 업데이트 방법 [1]
5639차가워4/4/20224276c++ 서버 c# 클라이언트 호환 문의 [1]
5638초급4/3/20224579c# sql server 연동 [1]
5637따봉이4/1/20224845Winform Form Load 후 자동 캡쳐관련 [1]파일 다운로드1
5636김철순3/31/20224825WPF에서 Richtext의 View 문의 [5]
5635guest3/30/20224849안정적인 pinning이 가능하네요. [3]파일 다운로드1
5633꿀주세요3/30/20224482선생님 마우스 클릭이벤트 질문이 있습니다. [4]
5632김현수3/30/20224827Remote Desktop으로 접속시 WPF UI 가 다시 그려지는 이벤트를 막을 수 없을까요? [3]
5631김기헌3/24/20224455WPF 컨트롤의 그래픽 처리관련 질문드립니다 [2]파일 다운로드1
5630장성욱3/24/20224276로깅관련 질문입니다. [2]
5629감사합니...3/23/20224527함수에서 예외가 발생하면 try ~ catch처리기를 찾을 때 까지 상위 함수로 계속 올라가나요? [2]
5628홍길동3/23/20225168질문드립니다. [2]파일 다운로드1
5626연준혁3/21/20224416안녕하세요. [3]
5625jaew...3/18/20225346c# 8.0 도서를 구입한 사람입니다. [1]
5624초보자3/17/20224310람다 캡처 관련 문의 [2]
5623한예지 donator3/15/20224686인터프리터 원리가 궁금합니다. [4]
5622김민아3/8/20224605const와 readonly의 명확한 차이가 이게 맞나요? [2]
5621장성욱3/8/20224411c# 로그 관련 질문 [1]
5620김민아3/7/20224446안녕하세요 비관리 객체를 반환하는 메소드 호출 시 궁금한 점이 있어서 질문드립니다 [2]
5619팡팡이3/3/20225791RSA 문의드립니다. [3]
5618김기헌3/2/20224334안녕하세요 생성자 옆에 this 키워드를 붙여 생성자를 여러 개 호출 시 질문드립니다 [2]
1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...