Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory allocation failed #74

Open
bubnenkoff opened this issue Dec 10, 2017 · 15 comments
Open

Memory allocation failed #74

bubnenkoff opened this issue Dec 10, 2017 · 15 comments

Comments

@bubnenkoff
Copy link

I am trying to build simple app Windows 10 that produce select query to PG 9.6.
But on example I am getting error: core.exception.OutOfMemoryError@src\core\exception.d(696): Memory allocation failed
I am using latest DMD 2.077

What can be wrong?

@jacob-carlborg
Copy link
Collaborator

Do you have the source for the application available?

@bubnenkoff
Copy link
Author

PGConnection sourceConnection;
PGConnection targetConnection;

class Database
{
	Config config;

	this(Config config)
	{
		this.config = config;

		sourceConnection = new PGConnection(["host" : config.source_dbhost, "user": config.source_dbuser, "password" : config.source_dbpassword, "database" : config.source_dbname, "port" : config.source_port.to!string]);
		
	}
	
	int get_last_status_changes_counter_value()
	{
		writeln("aaa");
		string sql = `SELECT 	"last_status_changes_counter_value" FROM "tcopy_settings" WHERE "id" = 1;`;
		auto cmd = new PGCommand(sourceConnection, sql);
		writeln("bbb");
		auto result = cmd.executeQuery;

		foreach(i; result)
		{
			writeln(i);
		}

		return 1;
	}


}

@bubnenkoff
Copy link
Author

default

@jacob-carlborg
Copy link
Collaborator

Can you run it inside a debugger to get any more information? It's not much information to go on.

@bubnenkoff
Copy link
Author

For my regret now I can't do it. I have no free time :(
I understand that you support this lib in you free time, but I really have a lot of other job...

@jacob-carlborg
Copy link
Collaborator

jacob-carlborg commented Dec 17, 2017

Do you have the data set available that you run this query against?

@bubnenkoff
Copy link
Author

bubnenkoff commented Dec 17, 2017

There is only two columns:
"id", "last_status_changes_counter_value"
rows value:
1;576

@bubnenkoff
Copy link
Author

I am connecting to DB with VPN. But I do not thing it does matter. With Python all worked fine.

@jacob-carlborg
Copy link
Collaborator

jacob-carlborg commented Dec 17, 2017

  • Ok. Is it a 32bit or a 64bit build. If it's a 32bit build, do you use the Visual Studio tool chain?
  • To you have a possibility to test it without VPN or even on localhost?

@bubnenkoff
Copy link
Author

32, I have not VS
ok I will try to test on local PC

@jacob-carlborg
Copy link
Collaborator

OK, that would be great, trying to reduce things that can go wrong.

@bubnenkoff
Copy link
Author

Yes, it's work fine with PG 10.1 on Windows 10 without VPN.
I have no ideas how VPN can cause problem.

@jacob-carlborg
Copy link
Collaborator

Perhaps it's something in the socket implementation that the client is using to connect to the server. It would be quite difficult for me to debug since I don't have a VPN connection.

If you can compile druntime and Phobos you could try a debug build of the garbage collector. Basically enabling these three debug identifiers [1] and recompile druntime and Phobos. Then recompiling and run your application. After running the application it should have created a file gcx.log in the current directory with some debug info.

[1] https://github.com/dlang/druntime/blob/master/src/gc/impl/conservative/gc.d#L20-L22

@bubnenkoff
Copy link
Author

If it's issue with GC than mysql-native have same problem on x32 builds. Because I remember that developer of mysql-native said that GC on 32 is very buggy. But now I do not want to install any VS-related stuff, because now I am writing on D no more that 1 hour per week.

In any case thanks!

@jacob-carlborg
Copy link
Collaborator

The GC might not be the issue but a debug build can provide some additional information to figure out what's wrong, perhaps a stacktrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants